zoukankan      html  css  js  c++  java
  • codeforces 705A:Hulk

    Description

    Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely talk when he turns into the incredible Hulk. That's why he asked you to help him to express his feelings.

    Hulk likes the Inception so much, and like that his feelings are complicated. They have n layers. The first layer is hate, second one is love, third one is hate and so on...

    For example if n = 1, then his feeling is "I hate it" or if n = 2 it's "I hate that I love it", and if n = 3 it's "I hate that I love that I hate it" and so on.

    Please help Dr. Banner.

    Input

    The only line of the input contains a single integer n (1 ≤ n ≤ 100) — the number of layers of love and hate.

    Output

    Print Dr.Banner's feeling in one line.

    Examples
    Input
    1
    Output
    I hate it
    Input
    2
    Output
    I hate that I love it
    Input
    3
    Output
    I hate that I love that I hate it



    正解:
    模拟
    解题报告:
      大大大水题,模拟即可。

     1 //It is made by jump~
     2 #include <iostream>
     3 #include <cstdlib>
     4 #include <cstring>
     5 #include <cstdio>
     6 #include <cmath>
     7 #include <algorithm>
     8 using namespace std;
     9 int n;
    10 inline int getint()
    11 {
    12        int w=0,q=0;
    13        char c=getchar();
    14        while((c<'0' || c>'9') && c!='-') c=getchar();
    15        if (c=='-')  q=1, c=getchar();
    16        while (c>='0' && c<='9') w=w*10+c-'0', c=getchar();
    17        return q ? -w : w;
    18 }
    19 
    20 inline void work(){
    21     n=getint();
    22     for(int i=1;i<=n;i++) {
    23     if(i!=1) printf("that ");
    24     if(i&1) {
    25         printf("I hate ");
    26     }
    27     else{
    28         printf("I love ");
    29     }
    30     }
    31     printf("it");
    32 }
    33 
    34 int main()
    35 {
    36   work();
    37   return 0;
    38 }
    
    
  • 相关阅读:
    【转载】PyQt QSetting保存设置
    Python WebDriver自动化测试
    Pyqt 控件的信号槽事件定义方法
    Pyqt SpVoice朗读功能
    Pyqt 国际化多语言支持
    MQTT研究之EMQ:【wireshark抓包分析】
    MQTT研究之EMQ:【SSL双向验证】
    ES6模板字符串【${}配合反单引号一起用】
    express中遇到的一个小问题“403”
    MQTT研究之EMQ:【基础研究】
  • 原文地址:https://www.cnblogs.com/ljh2000-jump/p/5756826.html
Copyright © 2011-2022 走看看