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 }
  • 相关阅读:
    Docker端口映射实现
    Docker容器访问控制
    Docker配置 DNS
    Docker快速配置指南
    Docker外部访问容器
    Docker容器如何互联
    Docker 备份、恢复、迁移数据卷
    19.30内置登录处理
    18.29SSM基础整合开发
    19.30内置登录处理
  • 原文地址:https://www.cnblogs.com/hsd-/p/5747854.html
Copyright © 2011-2022 走看看