A. Hulk
time limit per test1 second
memory limit per test256 megabytes
inputstandard input
outputstandard 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.
InputThe only line of the input contains a single integer n (1 ≤ n ≤ 100) — the number of layers of love and hate.
OutputPrint Dr.Banner's feeling in one line.
Examplesinput1outputI hate itinput2outputI hate that I love itinput3outputI hate that I love that I hate it
题意:
根据输入n的大小循环I hate that I love that I hate it...
自古PA多水题,判断奇偶然后做输出就好了。
附AC代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
string s1="I hate that ",s2="I love that ",s4="I love it",s3="I hate it";
int n,ans=;
cin>>n;
for(int i=;i<n;i++){
if(ans==){
cout<<s1;
ans=;
continue;
}
else{
cout<<s2;
ans=;
continue;
} }
if(n%==)
cout<<s3;
else
cout<<s4;
return ;
}
A. Hulk的更多相关文章
- DDOS hulk,rudy
HULK (HTTP Unbearable Load King) HULK HULK是另一个DOS攻击工具,这个工具使用UserAgent的伪造,来避免攻击检测,可以通过启动500线程对目标发起高频率 ...
- codeforces 705A:Hulk
Description Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely ta ...
- 美团集群调度系统HULK技术演进
本文根据美团基础架构部/弹性策略团队负责人涂扬在2019 QCon(全球软件开发大会)上的演讲内容整理而成.本文涉及Kubernetes集群管理技术,美团相关的技术实践可参考此前发布的<美团点评 ...
- CodeForces 705A Hulk (水题)
题意:输入一个 n,让你输出一行字符串. 析:很水题,只要判定奇偶性,输出就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,10240 ...
- 【模拟】Codeforces 705A Hulk
题目链接: http://codeforces.com/problemset/problem/705/A 题目大意: 给一个数N(N<=100),N=1时输出"I hate it&qu ...
- CodeForces 705A Hulk
水题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #includ ...
- 【Henu ACM Round #13 A】 Hulk
[链接] 我是链接,点我呀:) [题意] 在这里输入题意 [题解] 模拟. [代码] #include <bits/stdc++.h> using namespace std; int m ...
- C#数组,List,Dictionary的相互转换
本篇文章会向大家实例讲述以下内容: 将数组转换为List 将List转换为数组 将数组转换为Dictionary 将Dictionary 转换为数组 将List转换为Dictionary 将Dicti ...
- cookies如何成为全局变量以及设置,删除,获取
(一)cookie机制将信息存储于用户硬盘,因此可以作为全局变量 (1)保存用户登录状态.例如将用户id存储于一个cookie内,这样当用户下次访问该页面时就不需要重新登录了,现在很多论坛和社区都提供 ...
随机推荐
- Ionic 学习笔记
本文为原创,转载请注明出处: cnzt 文章:cnzt-p http://www.cnblogs.com/zt-blog/p/7831153.html 注: 本篇学习笔记基于Ionic 3 ...
- C#中值类型和引用类型的差别浅记
C#中值类型和引用类型的差别浅记 在C#中,变量的类型分为两种.各自是值类型和引用类型. 值类型的变量直接存储值,说得更详细一些,就是值类型变量在内存中直接存储它们自身 ...
- weex 引导页(guide)页面
slider 和 indicator 都是 weex 的内置组件,且 indicator 是 slider 的子组件. 1.报错处理 原因解析:indicator 样式页面渲染慢 解决方案:indic ...
- Android手机输入法按键监听-dispatchKeyEvent
近期在项目开发中遇到一个关于手机输入键盘的坑.特来记录下. 应用场景: 项目中有一个界面是用viewpaper加三个fragment写的,当中viewpaper被我屏蔽了左右滑动,上面有三个点击按钮, ...
- UML类间关系
1继承 指的是一个类(称为子类.子接口)继承另外的一个类(称为父类.父接口)的功能,并可以增加它自己的新功能的能力,继承是类与类或者接口与接口之间最常见的关系:在Java中此类关系通过关键字exten ...
- 走入asp.net mvc不归路:[5]Action的返回
asp.net mvc提供了多种返回方式,一方面使得视图可以重用,另一方面灵活强大,有直接返回视图,返回Json,返回文件流,返回到相同Controller的Action,返回到另一个Controll ...
- 如何快速上手一款新的嵌入式CPU芯片(记录CC2540开发经历)
新换了工作,需要熟悉新公司的产品开发项目,更新博客就懈怠了,不过环境的不同,也让我对嵌入式开发有了更深刻的理解.在原公司我主要负责在STM32F207芯片平台上, 利用UCOS+LWIP进行嵌入式服务 ...
- 记录:50多行程序中找出多写的一个字母e
小霍同学调程序,做的是第11周的项目1 - 存储班长信息的学生类,可是她写的程序(就在以下),呃,请读者自己执行一下吧.(下午在机房调试时用的是Code::Blocks10.05.输出的是非常长的莫名 ...
- 使用DWR实现自己主动补全 相似百度搜索框的自己主动显示效果
使用DWR实现自己主动补全 自己主动补全:是指用户在文本框中输入前几个字母或汉字的时候,自己主动在存放数据的文件或数据库中将全部以这些字母或汉字开头的数据提示给用户供用户选择 在日常上网过程中,我们常 ...
- 获取Wifi密码,不知道是不是真的
package com.example.wifipassword; import java.util.List; import android.app.Activity; import android ...