codeforces 705A:Hulk
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.
The only line of the input contains a single integer n (1 ≤ n ≤ 100) — the number of layers of love and hate.
Print Dr.Banner's feeling in one line.
1
I hate it
2
I hate that I love it
3
I hate that I love that I hate it 正解:模拟
解题报告:
大大大水题,模拟即可。
//It is made by jump~
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int n;
inline int getint()
{
int w=,q=;
char c=getchar();
while((c<'' || c>'') && c!='-') c=getchar();
if (c=='-') q=, c=getchar();
while (c>='' && c<='') w=w*+c-'', c=getchar();
return q ? -w : w;
} inline void work(){
n=getint();
for(int i=;i<=n;i++) {
if(i!=) printf("that ");
if(i&) {
printf("I hate ");
}
else{
printf("I love ");
}
}
printf("it");
} int main()
{
work();
return ;
}
codeforces 705A:Hulk的更多相关文章
- 【模拟】Codeforces 705A Hulk
题目链接: http://codeforces.com/problemset/problem/705/A 题目大意: 给一个数N(N<=100),N=1时输出"I hate it&qu ...
- CodeForces 705A Hulk (水题)
题意:输入一个 n,让你输出一行字符串. 析:很水题,只要判定奇偶性,输出就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,10240 ...
- CodeForces 705A Hulk
水题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #includ ...
- Codeforces 731C:Socks(并查集)
http://codeforces.com/problemset/problem/731/C 题意:有n只袜子,m天,k个颜色,每个袜子有一个颜色,再给出m天,每天有两只袜子,每只袜子可能不同颜色,问 ...
- Codeforces 747D:Winter Is Coming(贪心)
http://codeforces.com/problemset/problem/747/D 题意:有n天,k次使用冬天轮胎的机会,无限次使用夏天轮胎的机会,如果t<=0必须使用冬轮,其他随意. ...
- Codeforces 747C:Servers(模拟)
http://codeforces.com/problemset/problem/747/C 题意:有n台机器,q个操作.每次操作从ti时间开始,需要ki台机器,花费di的时间.每次选择机器从小到大开 ...
- Codeforces 749D:Leaving Auction(set+二分)
http://codeforces.com/contest/749/problem/D 题意:有几个人在拍卖场竞价,一共有n次喊价,有q个询问,每一个询问有一个num,接下来num个人从这次拍卖中除去 ...
- Codeforces 749B:Parallelogram is Back(计算几何)
http://codeforces.com/problemset/problem/749/B 题意:已知平行四边形三个顶点,求另外一个顶点可能的位置. 思路:用向量来做. #include <c ...
- Codeforces 749C:Voting(暴力模拟)
http://codeforces.com/problemset/problem/749/C 题意:有n个人投票,分为 D 和 R 两派,从1~n的顺序投票,轮到某人投票的时候,他可以将对方的一个人K ...
随机推荐
- inner join和out join的区别
inner join(又叫join) out join包括left join,right join和full join(也就是left+right)
- Xamarin.Forms学习之初
微软的Build 2016结束的有段时间了,对于一个简单的小屌丝程序员--我来说,关注最大的无疑是Xamarin的免费(开源什么的让大神们上吧),内心激动啊.大会结束的周末我就迫不及待的安装了,然后. ...
- 巨蟒python全栈开发linux之centos4
1.linux虚拟环境1-4 2.linux运行crm代码
- Service 事务(JdbcUtils 升级)
1. DAO 事务 // 在 DAO 中处理事务真是"小菜一碟" public void xxx(){ Connection con = null; try{ con = Jdbc ...
- 编译java-cef
javacef即java Chromium Embedded Framework,其功能是通过在java应用中嵌入谷歌浏览器内核Chromium. 编译java-cef的过程可参考以下文档及视频: h ...
- InnoDB 与 MyISAM 区别
1.myisam可以对索引进行压缩,innodb不压缩 2.索引都用b-tree, innodb使用 b+tree,NDB Cluster使用 T-Tree. 3.myisam 表级锁, inno ...
- hive查询表,返回结果是null
问题:hive查询表,返回结果都是null hive> create table testTable(id int, name string); hive> load data local ...
- F110操作手册-自动付款
SAP 系统 F110系统操作手册 目 录 1.自动付款... 3 1.自动付款 事务代号: F110 菜单路径: 会计 →财 ...
- java定时器的使用(Timer)(转发:https://blog.csdn.net/ecjtuxuan/article/details/2093757)
1.在应用开发中,经常需要一些周期性的操作,比如每5分钟执行某一操作等. 对于这样的操作最方便.高效的实现方式就是使用java.util.Timer工具类. private java.util.Tim ...
- root用户无法修改文件权限(lsattr/chattr: i 和 a 属性含义)
今天想在实验室分配的服务器上添加一个普通用户, 所以用root身份登录服务器后执行useradd命令,却提示无法读写 /etc/shadow文件; ls -l /etc/shadow发现什么权限都没有 ...