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 ...
随机推荐
- linux 终端操作快捷键
熟练使用快捷键可以很大的提高效率,以下列出一些常用的快捷键命令方便随时查阅 1. 移动光标 Ctrl + a 标移到行首.它在多数文本编辑器和 Mozilla 的 URL 字段内可以使用.Ctrl + ...
- mysql_表_操作
1.创建表 # 基本语法: create table 表名( 列名 类型 是否可以为空 默认值 自增 主键, 列名 类型 是否可以为空 )ENGINE=InnoDB DEFAULT CHARSET=u ...
- Python 模块相对引用
文件结构如下 python_directory/ ├── __init__.py └── app ├── __init__.py ├── sub1 │ ├── __init__.py │ └─ ...
- 搭建Spring所需的各类jar包汇总详解
Spring jar包官网下载地址:http://repo.spring.io/release/org/springframework/spring/ Spring jar包的描述:针对3.2.2以上 ...
- Maven学习笔记【1】 -- Maven简介
本文主要讲Maven的基础知识. 一 什么是Maven? Maven是一个项目管理工具.Maven提供了一个项目对象模型(POM)文件的新概念来管理项目的构建,相关性和文档.最强大的功能就是能够自动下 ...
- Unity使用native读取streamingasset里文件
需求是,使用native方式,读取apk包里的lua代码,读进c#,做解密 一准备unity工程 public class GameMain : MonoBehaviour { public cons ...
- pycharm中导入自写模块时,模块下出现红线
问题描述: 在pycharm中导入自己写的模块时,得不到智能提示,并在模块名下出现下红线,但是代码可以执行,错误提示为下图所示: 原因:出现 以上情况,是因为文件目录设置的问题,pycharm中的最上 ...
- orange安装文档
一.Orange简介 Orange是一个基于 OpenResty/Nginx 的 API Gateway,提供 API 及 “自定义规则” 的监控和管理,如访问统计.流量切分.AB 测试.API ...
- Putty常用属性设置
1. 使用 UTF-8避免显示乱码 2.调整 Lines of scrollback,能够回看更多的控制台输出log 3.调整颜色和字体使得看上去更舒服 4.解决数字键盘无法输入数字的问题 效果图:
- C51数据类型