はまやんはまやんはまやん

hamayanhamayan's blog

Hulk [Codeforces 366 : Div2 A]

問題

http://codeforces.com/contest/705/problem/A

n = 1 : "I hate it"
n = 2 : "I hate that I love it"
n = 3 : "I hate that I love that I hate it"
のようにnが増えるたびにhateとloveを繰り返して出力せよ

1 <= n <= 100

考察

1. 問題文の和訳として残しておくための記事
2. やるだけ

実装

http://codeforces.com/contest/705/submission/19711304

int n;
//-----------------------------------------------------------------
int main() {
	cin >> n;
	rep(i, 0, n) {
		if (i != 0) cout << "that ";

		if (i % 2 == 0)
			cout << "I hate ";
		else
			cout << "I love ";
	}
	cout << "it" << endl;
}