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 }
  • 相关阅读:
    Pytorch使用tensorboardX可视化。超详细!!!
    pytorch旧版安装
    Pytorch的网络结构可视化(tensorboardX)(详细)
    PyTorch代码调试利器: 自动print每行代码的Tensor信息
    权重衰减(weight decay)与学习率衰减(learning rate decay)
    pytorch的backward
    PyTorch入门学习(二):Autogard之自动求梯度
    Pytorch
    Python之线程、进程和协程
    Python之logging模块
  • 原文地址:https://www.cnblogs.com/hsd-/p/5747854.html
Copyright © 2011-2022 走看看