题目链接:

  http://codeforces.com/problemset/problem/705/A

题目大意:

  给一个数N(N<=100),N=1时输出"I hate it",N=2输出"I hate that I love it",N=3输出"I hate that I love that I hate it"以此类推迭代下去。

题目思路:

  【模拟】

  暴力模拟即可,签到题。

 1 //
 2 //by coolxxx
 3 //#include<bits/stdc++.h>
 4 #include<iostream>
 5 #include<algorithm>
 6 #include<string>
 7 #include<iomanip>
 8 #include<map>
 9 #include<memory.h>
10 #include<time.h>
11 #include<stdio.h>
12 #include<stdlib.h>
13 #include<string.h>
14 //#include<stdbool.h>
15 #include<math.h>
16 #define min(a,b) ((a)<(b)?(a):(b))
17 #define max(a,b) ((a)>(b)?(a):(b))
18 #define abs(a) ((a)>0?(a):(-(a)))
19 #define lowbit(a) (a&(-a))
20 #define sqr(a) ((a)*(a))
21 #define swap(a,b) ((a)^=(b),(b)^=(a),(a)^=(b))
22 #define mem(a,b) memset(a,b,sizeof(a))
23 #define eps (1e-8)
24 #define J 10
25 #define mod 1000000007
26 #define MAX 0x7f7f7f7f
27 #define PI 3.14159265358979323
28 #define N 104
29 using namespace std;
30 typedef long long LL;
31 int cas,cass;
32 int n,m,lll,ans;
33 string ss;
34 int main()
35 {
36     #ifndef ONLINE_JUDGE
37 //    freopen("1.txt","r",stdin);
38 //    freopen("2.txt","w",stdout);
39     #endif
40     int i,j,k;
41 //    for(scanf("%d",&cas);cas;cas--)
42 //    for(scanf("%d",&cas),cass=1;cass<=cas;cass++)
43 //    while(~scanf("%s",s+1))
44     while(~scanf("%d",&n))
45     {
46         if(n==1){puts("I hate it");continue;}
47         ss="I hate ";
48         for(i=2;i<=n;i++)
49             if(i&1)ss+="that I hate ";
50             else ss+="that I love ";
51         ss+="it";
52         cout<<ss<<endl;
53     }
54     return 0;
55 }
56 /*
57 //
58
59 //
60 */

View Code

转载于:https://www.cnblogs.com/Coolxxx/p/5794132.html

【模拟】Codeforces 705A Hulk相关推荐

  1. 模拟 Codeforces Round #249 (Div. 2) C. Cardiogram

    题目地址:http://codeforces.com/contest/435/problem/C 1 /* 2 题意:给一组公式,一组数据,计算得到一系列的坐标点,画出折线图:) 3 模拟题:蛮恶心的 ...

  2. 模拟 Codeforces Round #297 (Div. 2) A. Vitaliy and Pie

    题目传送门 1 /* 2 模拟:这就是一道模拟水题,看到标签是贪心,还以为错了呢 3 题目倒是很长:) 4 */ 5 #include <cstdio> 6 #include <al ...

  3. 模拟 Codeforces Round #288 (Div. 2) A. Pasha and Pixels

    题目传送门 1 /* 2 模拟水题:给定n*m的空白方格,k次涂色,将(x,y)处的涂成黑色,判断第几次能形成2*2的黑色方格,若不能,输出0 3 很挫的判断四个方向是否OK 4 */ 5 #incl ...

  4. QDU-Training-01

    QDU-Training-01 题号 题目 知识点 难度 CodeForces 76E Points 数论 HDU 4608 I-number 模拟 CodeForces 616D Longest k ...

  5. SDU程序设计思维实践题目总结

    题目来源及链接 题目名称及讲解博客链接 涉及算法 原题以及原题链接 第二周作业 Maze BFS POJ-3984 Pour water BFS POJ-1606 第二周实验 化学 模拟 codefo ...

  6. 2019组队赛第二场(ACM International Collegiate Programming Contest, Arabella Collegiate 解题报告 Apare_xzc

    2019组队赛第二场(ACM International Collegiate Programming Contest, Arabella Collegiate 解题报告 by xzc,zx,lj 先 ...

  7. C语言中如何用循环编译菱形,c语言for循环如何打印菱形

    c语言for循环如何打印菱形 c语言for循环打印菱形的方法:使用两个for循环,实现条件判断,代码为[int i,j;for(i=0; i<2*n-1; i++){if(i=n-i-1& ...

  8. Codeforces Round #304 C(Div. 2)(模拟)

    题目链接: http://codeforces.com/problemset/problem/546/C 题意: 总共有n张牌,1手中有k1张分别为:x1, x2, x3, ..xk1,2手中有k2张 ...

  9. BZOJ 3836 Codeforces 280D k-Maximum Subsequence Sum (模拟费用流、线段树)

    题目链接 (BZOJ) https://www.lydsy.com/JudgeOnline/problem.php?id=3836 (Codeforces) http://codeforces.com ...

最新文章

  1. 北京工业计算机考研科目,2020北京工业大学计算机考研初试科目、参考书目、招生人数汇总...
  2. 关于 HANA CE Function
  3. Redis如何支持高并发的访问
  4. 谷歌开源Embedding可视化工具
  5. 企业打开云HBase的正确方式,来自阿里云云数据库团队的解读
  6. python 两个nc文件 风场,ECMWF 不同step 的 NC 文件如何合并
  7. Unity运行时输出场景物体及角色为fbx文件
  8. 火狐浏览器装ie tab出现问题出现组件冲突,标题栏一直显示正在连接,附加组件打不开,解决
  9. C语言华氏度转换摄氏度
  10. android 处理闪屏
  11. android 手机 多分辨率适配
  12. 图书馆服务器虚拟化实施方案,服务器虚拟化与图书馆实施策略.pdf
  13. 少儿编程网站源码和scratch课程
  14. firefox 配置
  15. (46)改变占空比与相移
  16. 全球 43 亿个 IPv4 地址正式耗尽!【智能快讯】
  17. 欠款人都没车没房没存款,还起诉吗?
  18. StoryBoard运用技巧
  19. 关于Github上zheng项目部署问题总结
  20. PTA出现EOFError

热门文章

  1. ORACLE sqlplus set 命令速查
  2. 程序员,请您不要老是熬夜
  3. linux最简单搭建邮件服务器
  4. 学习Knowledge Graph Embedding Based Question Answering代码笔记
  5. 创建一个dynamics 365 CRM online plugin (四) - PreValidation
  6. 利用STM32F唯一96bit序列号实现反拷贝加密的源代码公开(转)
  7. [转]MSXML版本历史
  8. 基于GDI+用C#编写的.NET流程图控件开发周记(2011-08-28)
  9. 加速Javascript:DOM操作优化
  10. SqlHelper 数据库操作类