zoukankan      html  css  js  c++  java
  • Codeforces Round #366 (Div. 2) A

    A. Hulk
    time limit per test
    1 second
    memory limit per test
    256 megabytes
    input
    standard input
    output
    standard output

    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 /******************************
     2 code by drizzle
     3 blog: www.cnblogs.com/hsd-/
     4 ^ ^    ^ ^
     5  O      O
     6 ******************************/
     7 //#include<bits/stdc++.h>
     8 #include<iostream>
     9 #include<cstring>
    10 #include<cstdio>
    11 #include<map>
    12 #include<algorithm>
    13 #include<queue>
    14 #include<cmath>
    15 #define ll __int64
    16 #define PI acos(-1.0)
    17 #define mod 1000000007
    18 using namespace std;
    19 int n;
    20 int main()
    21 {
    22     scanf("%d",&n);
    23     for(int i=1;i<=n;i++)
    24     {
    25         if(i%2==1)
    26             cout<<"I hate";
    27         if(i%2==0)
    28             cout<<"I love";
    29         if(i!=n)
    30             cout<<" that ";
    31         if(i==n)
    32             cout<<" it"<<endl;
    33     }
    34     return 0;
    35 }
  • 相关阅读:
    支付宝支付私钥和公钥创建
    (五)Maven中的聚合和继承
    Windows 下Nexus搭建Maven私服
    (四)Maven中的仓库
    zookeeper安装和使用 windows环境
    (一)Redis之简介和windows下安装radis
    (错误) Eclipse使用Maven创建Web时错误
    (三)引用中央仓库中不存在的jar包
    (二)依赖传递
    (一)Maven基础及第一个Maven工程
  • 原文地址:https://www.cnblogs.com/hsd-/p/5747854.html
Copyright © 2011-2022 走看看