Codeforces Round #366 (Div. 2) A. Hulk (简单模拟)
来源:互联网 发布:java入门到精通pdf 编辑:程序博客网 时间:2024/04/29 15:19
题目链接
给出一个n表示,说n次,说话的规律是第一次I hate ,第二次是 I love
判断奇偶输出
#include<bits/stdc++.h>using namespace std;#define cl(a,b) memset(a,b,sizeof(a))#define LL long long#define pb push_back#define gcd __gcd#define For(i,j,k) for(int i=(j);i<k;i++)#define lowbit(i) (i&(-i))#define _(x) printf("%d\n",x)const int maxn = 1e3+10;const int inf = 1 << 28;int main(){ int n; cin>>n; if(n==1){ cout<<"I hate it"<<endl;return 0; } if(n%2==0){ for(int i=0;i<max(n-2,0)/2;i++){ cout<<"I hate that I love that "; } cout<<"I hate that I love it"<<endl; } else { for(int i=0;i<n/2;i++){ cout<<"I hate that I love that "; } cout<<"I hate it"<<endl; } return 0;}
0 0
- Codeforces Round #366 (Div. 2) A. Hulk (简单模拟)
- Codeforces Round #366 (Div. 2) A. Hulk
- 【Codeforces Round #366 (Div. 2)】Codeforces 705A Hulk
- Codeforces #366(Div.2)A.Hulk【水题】
- CF-Codeforces Round #366 (Div. 2)-A-Hulk
- Codeforces Round #107 (Div. 2) A(简单模拟)
- Codeforces Round #109 (Div. 2) A (简单模拟)
- 【模拟】Codeforces 705A Hulk
- Codeforces Round #346 (Div. 2) -A. Round House(模拟)
- Codeforces Round #297 (Div. 2) A(模拟)
- Codeforces Round #340 (Div. 2)(A) 模拟
- Codeforces Round #259 (Div. 2) A. Little Pony and Crystal Mine(简单模拟实现题)
- Codeforces Round #403 (Div. 2) A. Andryusha and Socks(简单模拟)
- Codeforces Round #281 (Div. 2)A(构造+暴力模拟)
- Codeforces Round #328 (Div. 2)Problem A. PawnChess(模拟)
- Codeforces Round #335 (Div. 2) (A)模拟
- Codeforces Round #341 (Div. 2)(A)模拟
- Codeforces Round #294 (Div. 2)(A)模拟
- Spring Boot 监听器 过滤器 Servlet 实例
- PAT乙级:1008. 数组元素循环右移问题 (Java)
- HDU 5804 Price List
- [DP]Bridge设计模式
- docker-compose的安装和设定
- Codeforces Round #366 (Div. 2) A. Hulk (简单模拟)
- 领导说我对任务的理解是错的
- Codeforces Round #366 (Div. 2) B. Spider Man (组合游戏)
- 夏令营day4总结
- 《技术人创业攻略》-用技术改变世界!
- PAT乙级:1006. 换个格式输出整数 (Java)
- Codeforces Round #366 (Div. 2) C. Thor(模拟)
- 在PyCharm中运行django 项目
- JAVAIO一次写入任意字符固定套路