题目链接:

  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==){puts("I hate it");continue;}
  47. ss="I hate ";
  48. for(i=;i<=n;i++)
  49. if(i&)ss+="that I hate ";
  50. else ss+="that I love ";
  51. ss+="it";
  52. cout<<ss<<endl;
  53. }
  54. return ;
  55. }
  56. /*
  57. //
  58.  
  59. //
  60. */

【模拟】Codeforces 705A Hulk的更多相关文章

  1. CodeForces 705A Hulk (水题)

    题意:输入一个 n,让你输出一行字符串. 析:很水题,只要判定奇偶性,输出就好. 代码如下: #pragma comment(linker, "/STACK:1024000000,10240 ...

  2. CodeForces 705A Hulk

    水题. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #includ ...

  3. codeforces 705A:Hulk

    Description Dr. Bruce Banner hates his enemies (like others don't). As we all know, he can barely ta ...

  4. 贪心+模拟 Codeforces Round #288 (Div. 2) C. Anya and Ghosts

    题目传送门 /* 贪心 + 模拟:首先,如果蜡烛的燃烧时间小于最少需要点燃的蜡烛数一定是-1(蜡烛是1秒点一支), num[g[i]]记录每个鬼访问时已点燃的蜡烛数,若不够,tmp为还需要的蜡烛数, ...

  5. 模拟 Codeforces Round #203 (Div. 2) C. Bombs

    题目地址:http://codeforces.com/problemset/problem/350/C /* 题意:机器人上下左右走路,把其他的机器人都干掉要几步,好吧我其实没读懂题目, 看着样例猜出 ...

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

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

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

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

  8. queue+模拟 Codeforces Round #304 (Div. 2) C. Soldier and Cards

    题目传送门 /* 题意:两堆牌,每次拿出上面的牌做比较,大的一方收走两张牌,直到一方没有牌 queue容器:模拟上述过程,当次数达到最大值时判断为-1 */ #include <cstdio&g ...

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

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

随机推荐

  1. 详细分析Orchard的Content、Drivers, Shapes and Placement 类型

    本文原文来自:http://skywalkersoftwaredevelopment.net/blog/a-closer-look-at-content-types-drivers-shapes-an ...

  2. CSS3新增Hsl、Hsla、Rgba色彩模式以及透明属性(转)

    CSS2中色彩模式只有RGB色彩模式(RGB即RED.Green.BLue)和十六进制(Hex)模式,为了能支持 透明opacity 的Alpha值,CSS3又增加了RGBA色彩模式(RGBA即RED ...

  3. 用于显示上个月和下个月_PHP

    /** * 用于显示上个月和下个月 * @param int $sign 1:表示上个月 0:表示下个月 * @return string */ function GetMonth($sign=&qu ...

  4. Orace数据库锁表的处理与总结<摘抄与总结一>

    TM锁(表级锁)类型共有5种,分别称为共享锁(S锁).排它锁(X锁).行级共享锁(RS锁).行级排它锁(RX锁).共享行级排它锁(SRX锁) 当Oracle执行DML语句时,系统自动在所要操作的表上申 ...

  5. oracle官方文档- length篇

    一.首先介绍下单字节字符集和 多字节字符集 2.2字符编码方案 2.2.1 单字节编码     (1)单字节7位字符集,可以定义128个字符,最常用的字符集为 US7ASCII     (2)单字节8 ...

  6. node-http-proxy修改响应结果

    最近在项目中使用node-http-proxy遇到需要修改代理服务器响应结果需求,该库已提供修改响应格式为html的方案:Harmon,而项目中返回格式统一为json,使用它感觉太笨重了,所以自己写了 ...

  7. hdoj 1089(费马小定理)

    题目大意:方程f(x)=5*x^13+13*x^5+k*a*x:输入任意一个数k,是否存在一个数a,对任意x都能使得f(x)能被65整出. 现假设存在这个数a ,因为对于任意x方程都成立 所以,当x= ...

  8. js 之 复制一段代码

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. 用arm-linux-gcc v4.3.4交叉编译Qt4.8.3

    1.解压缩 #tar zxvf  qt-everywhere-opensource-src-4.8.3.tar.gz 2. configure #mkdir buildarm-static #cd b ...

  10. js登录页面的 回车事件

    js登录页面的 回车事件 js登录页面的 回车事件(2012-12-26 10:37:03)转载▼标签: jseventkey回车事件登录 分类: js.jquery  //回车事件 第一种docum ...