标签:
题意:输入一个 n,让你输出一行字符串。
析:很水题,只要判定奇偶性,输出就好。
代码如下:
#pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include <cstring> #include <set> #include <queue> #include <algorithm> #include <vector> #include <map> #include <cctype> using namespace std ; typedef long long LL; typedef pair<int, int> P; const int INF = 0x3f3f3f3f; const double inf = 0x3f3f3f3f3f3f3f; const double eps = 1e-8; const int maxn = 1e4 + 5; const int mod = 1e9 + 7; const int dr[] = {0, 0, -1, 1}; const int dc[] = {-1, 1, 0, 0}; int n, m; inline bool is_in(int r, int c){ return r >= 0 && r < n && c >= 0 && c < m; } int main(){ int n; cin >> n; for(int i = 1; i < n; ++i) if(i & 1) printf("I hate that "); else printf("I love that "); if(n & 1) printf("I hate it\n"); else printf("I love it\n"); return 0; }
标签:
原文地址:http://www.cnblogs.com/dwtfukgv/p/5747840.html