text
stringlengths 49
983k
|
|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << "I hate";
for (int i = 2; i <= a; i++) {
if (i % 2 == 0)
cout << " that I love";
else
cout << " that I hate";
}
cout << " it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%i", &n);
printf("I hate");
for (int i = 1; i < n; i++) {
if (i % 2 != 0)
printf(" that I love");
else
printf(" that I hate");
}
printf(" it");
return 0;
}
|
#include <bits/stdc++.h>
int main(int argc, char const *argv[]) {
char a[] = "I hate that ";
char b[] = "I love that ";
char c[] = "I hate it";
char d[] = "I love it";
char str[2048];
int i = 0;
scanf("%d", &i);
for (int j = 1; j < i; j++) {
if (j % 2 == 1) strcat(str, a);
if (j % 2 == 0) strcat(str, b);
}
if (i % 2 == 1)
strcat(str, c);
else
strcat(str, d);
printf("%s", str);
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
for (int i = 1; i <= n; i++) {
if (n == 1) {
std::cout << "I hate ";
break;
}
if (i % 2) {
std::cout << "I hate ";
} else {
std::cout << "I love ";
}
if (i != n) {
std::cout << "that ";
}
}
std::cout << "it" << std::endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string s = "I hate";
string t = "I love";
string q = "that";
int n;
scanf("%d", &n);
int i;
for (i = 1; i <= n; ++i) {
if (i % 2 == 1) cout << s << " ";
if (i % 2 == 0) cout << t << " ";
if (i != n) cout << q << " ";
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n, i;
scanf("%d", &n);
printf("I hate ");
for (i = 2; i <= n; i++) {
if (i % 2 == 0)
printf("that I love ");
else
printf("that I hate ");
}
printf("it");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string love = "I love that ", hate = "I hate that ";
int n;
cin >> n;
if (n == 1) {
cout << "I hate it";
} else if (n == 2) {
cout << "I hate that I love it";
} else {
if (n % 2 == 1) {
for (int i = 1; i < n; i++) {
if (i % 2 == 1) {
cout << hate;
} else {
cout << love;
}
}
cout << "I hate it";
} else {
for (int i = 1; i < n; i++) {
if (i % 2 == 1) {
cout << hate;
} else {
cout << love;
}
}
cout << "I love it";
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
char dem[45], a[10000000], b[10000000], c[10000], d[10000];
vector<int> a1;
int main() {
int s, n;
cin >> s;
for (int i = 1; i < s; i++) {
if (i % 2)
cout << "I hate that ";
else
cout << "I love that ";
}
if (s % 2)
cout << "I hate it";
else
cout << "I love it";
}
|
#include <bits/stdc++.h>
int main() {
int n, i;
scanf("%d", &n);
for (i = 0; i < n; i++) {
if (i % 2 == 0)
printf("I hate ");
else
printf("I love ");
if (i < n - 1) printf("that ");
}
printf("it");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
string nechet = "I hate ", chet = "I love ", fin = "it", spl = "that ";
int n;
cin >> n;
cout << nechet;
for (int i = 2; i <= n; i++) {
if (i % 2)
cout << spl << nechet;
else
cout << spl << chet;
}
cout << fin;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
string s1 = "I hate that ";
string s2 = "I love that ";
string s3;
for (int i = 1; i < n + 1; i++) {
if (i % 2 != 0)
s3.append(s1);
else
s3.append(s2);
}
s3.erase(s3.length() - 5);
s3.append("it");
printf("%s\n", s3.c_str());
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; i++) {
if (i % 2 == 0)
cout << "I hate " << ((i != n - 1) ? "that " : "it ");
else
cout << "I love " << ((i != n - 1) ? "that " : "it ");
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int num, a = 0, b, count = 1;
cin >> num;
for (int i = 1; i <= num; i++) {
if (i % 2 == 1)
cout << "I hate ";
else
cout << "I love ";
if (i != num)
cout << "that ";
else
break;
}
cout << "it\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
for (i = 1; i < n; i++) {
if (i % 2 == 1) {
cout << "I hate that ";
} else {
cout << "I love that ";
}
}
if (n % 2 == 1) {
cout << "I hate it" << endl;
} else if (n % 2 == 0) {
cout << "I love it" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 == 1)
cout << "I hate ";
else
cout << "I love ";
if (i != n) cout << "that ";
}
cout << " it ";
return 0;
}
|
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
const int MAXN = 100005;
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n - 1; ++i)
printf(i % 2 == 1 ? "I hate that " : "I love that ");
puts(n % 2 == 1 ? "I hate it" : "I love it");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 != 0) {
cout << "I hate ";
} else {
cout << "I love ";
}
if (i != n) {
cout << "that ";
} else {
cout << "it";
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string ans;
cin >> n;
ans = "";
for (int i = 1; i <= n; ++i) {
ans += " I";
if (i % 2 == 0)
ans += " love ";
else
ans += " hate ";
if (i < n) ans += "that";
}
ans += "it";
cout << ans;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int levels = 0;
string feelings[] = {"I hate", "I love"};
cin >> levels;
int i = 0;
while (levels--) {
if (i > 1) {
i = 0;
}
if (levels == 0) {
cout << feelings[i] << " it ";
} else {
cout << feelings[i] << " that ";
}
i++;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int MAX = 2e5 + 8;
const int INF = 1e9 + 1e5 + 2;
int main() {
bool b = 1;
string s, t;
int v;
ios_base::sync_with_stdio(0);
cin.tie(NULL);
cin >> v;
for (int i = 1; i < v; ++i) {
if (i % 2 != 0)
cout << "I hate that ";
else
cout << "I love that ";
}
if (v % 2 == 0)
cout << "I love it";
else
cout << "I hate it";
}
|
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long long int mod = 1000000007;
void print() { cout << endl; }
void printarray() { return; }
void scan() { return; }
template <typename T, typename... Args>
void print(T a, Args... arg) {
cout << a << " ";
print(arg...);
}
template <typename T, typename... Args>
void scan(T &a, Args &...arg) {
cin >> a;
scan(arg...);
}
template <typename T, typename... Args>
void scan(vector<T> &v, Args &...arg) {
for (auto &i : v) cin >> i;
scan(arg...);
}
template <typename T, typename... Args>
void printarray(vector<T> &v, Args &...arg) {
for (auto i : v) cout << i << " ";
cout << endl;
printarray(arg...);
}
long long int isPrime(long long int x) {
for (long long int i = 2; i <= x / 2; i++) {
if (x % i == 0) {
return 0;
}
}
return 1;
}
long long int binaryToDecimal(long long int n) {
long long int num = n;
long long int dec_value = 0;
long long int base = 1;
long long int temp = num;
while (temp) {
long long int last_digit = temp % 10;
temp = temp / 10;
dec_value += last_digit * base;
base = base * 2;
}
return dec_value;
}
long long int gcd(long long int a, long long int b) {
if (b == 0) return a;
return gcd(b, a % b);
}
long long int lcm(long long int a, long long int b) {
return a * b / gcd(a, b);
}
void solve() {
long long int n;
cin >> n;
for (long long int i = 0; i < n; i++) {
if (i % 2 == 0) {
cout << "I hate ";
} else if (i % 2 == 1) {
cout << "I love ";
}
if (i < n - 1) {
cout << "that ";
} else if (i == n - 1) {
cout << "it";
}
}
cout << "\n";
}
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
solve();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
cout << "I hate ";
if (a != 1) {
cout << "that ";
}
for (int i = 1; i < a; i++) {
if (i % 2 == 0) {
cout << "I hate ";
}
if (i % 2 == 1) {
cout << "I love ";
}
if (i != a - 1) {
cout << "that ";
}
}
cout << "it";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string hate, love, mid, end, full;
hate = "I hate ";
love = "I love ";
mid = "that ";
end = "it ";
full = "";
int n, i;
cin >> n;
for (i = 0; i < n; i++) {
if (i % 2 != 0) {
full = full + love;
if (i == n - 1) {
full = full + end;
} else {
full = full + mid;
}
} else {
full = full + hate;
if (i == n - 1) {
full = full + end;
} else {
full = full + mid;
}
}
}
cout << full << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
bool hate = 1;
bool first = 1;
cin >> n;
for (int i = 0; i < n; i++) {
if (first)
first = 0;
else {
cout << " that ";
}
if (hate) {
cout << "I hate";
} else
cout << "I love";
hate = !hate;
}
cout << " it\n";
}
|
#include <bits/stdc++.h>
using namespace std;
void Display(int &);
int main() {
int n;
cin >> n;
Display(n);
return 0;
}
void Display(int &n) {
for (int i = 1; i <= n; i++) {
if (i % 2 == 1) {
if (n == 1 || i == n) {
cout << "I hate ";
break;
}
cout << "I hate that ";
}
if (i % 2 == 0) {
if (n == 2 || i == n) {
cout << "I love ";
break;
}
cout << "I love that ";
}
}
cout << "it";
}
|
#include <bits/stdc++.h>
using namespace std;
long long n;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cout << "I ";
if (i % 2 == 1)
cout << "hate";
else
cout << "love";
cout << " ";
if (i == n)
cout << "it";
else
cout << "that ";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 != 0 && i != n)
cout << "I hate that ";
else if (i % 2 == 0 && i != n)
cout << "I love that ";
else if (i % 2 != 0 && i == n)
cout << "I hate it" << endl;
else if (i % 2 == 0 && i == n)
cout << "I love it" << endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
cout << "I hate ";
for (int i = 2; i <= n; i++) {
if (i % 2 == 0)
cout << "that I love ";
else
cout << "that I hate ";
}
cout << "it" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
for (i = 1; i <= n; i++) {
if (i > 1) {
cout << "that ";
}
if (i % 2 != 0) {
cout << "I hate ";
}
if (i % 2 == 0) {
cout << "I love ";
}
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2) {
if (i != 1) cout << "that ";
cout << "I hate ";
} else {
cout << "that ";
cout << "I love ";
}
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i < n; i++) {
if (i % 2 == 1) {
printf("I hate that ");
} else {
printf("I love that ");
}
}
if (n % 2 == 1) {
printf("I hate it\n");
}
if (n % 2 == 0) {
printf("I love it\n");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a[100], i, n;
string hate, love, s;
hate = "I hate that ";
love = "I love that ";
cin >> n;
for (i = 0; i < n - 1; i++)
if (i % 2 == 0)
s += hate;
else
s += love;
if (i % 2 == 0)
s += "I hate it";
else
s += "I love it";
cout << s;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
for (i = 1; i <= n; i++) {
if (n > 1) {
if (i % 2 == 0) {
cout << "I "
<< "love ";
} else {
cout << "I "
<< "hate ";
}
if (i == n) {
cout << "it ";
} else {
cout << "that ";
}
} else {
cout << "I hate it";
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
for (i = 0; i < n; i++) {
if (i % 2 == 0) {
if (i == n - 1)
cout << "I hate it";
else
cout << "I hate that ";
} else {
if (i == n - 1)
cout << "I love it";
else
cout << "I love that ";
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
string a, b;
a = "I love";
b = "I hate";
if (n == 1) {
cout << "I hate it" << endl;
} else {
cout << "I hate";
for (i = 2; i <= n; i++) {
if (i % 2 == 0) {
cout << " that " << a;
} else {
cout << " that " << b;
}
}
cout << " it" << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
bool hate = true;
while (n--) {
cout << "I " << (hate ? "hate " : "love ") << (n ? "that " : "it\n");
hate ^= 1;
}
}
|
#include <bits/stdc++.h>
int main() {
int n;
scanf("%d\n", &n);
int i = 1;
while (i <= n) {
if (i & 1)
printf("I hate ");
else
printf("I love ");
i++;
if (i <= n) printf(" that ");
}
printf("it");
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int count = 1;
while (count != n) {
if (count % 2 == 0)
cout << "I love that ";
else
cout << "I hate that ";
count++;
}
if (count % 2 == 1)
cout << "I hate it";
else {
cout << "I love it";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string str1 = "I hate it";
string str2 = "I hate that";
string str3 = "I love it";
string str4 = "I love that";
int n, i;
cin >> n;
if (n % 2 == 1) {
for (i = 0; i < n / 2; ++i) {
cout << str2 << " " << str4 << " ";
}
cout << str1 << endl;
} else if (n % 2 == 0) {
for (i = 0; i < n / 2 - 1; ++i) {
cout << str2 << " " << str4 << " ";
}
cout << str2 << " ";
cout << str3 << endl;
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 != 0)
cout << "I hate";
else
cout << "I love";
if (i < n)
cout << " that ";
else
cout << " it";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n - 1; i++) {
if (i % 2 == 1)
cout << "I hate that ";
else if (i % 2 == 0)
cout << "I love that ";
}
if (n % 2 == 0)
cout << "I love it" << endl;
else if (n % 2 == 1)
cout << "I hate it" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
long long i, a, d, b, x, j = 1, n;
int main() {
cin >> x;
if (x % 2 == 0) cout << "I hate that ";
if (x % 2 == 0) j++;
while (j < x) {
if (x % 2 == 1) cout << "I hate that ";
if (x % 2 == 0) cout << "I love that ";
x = x - 1;
}
if (x % 2 == 1) cout << "I hate it" << endl;
if (x % 2 == 0) cout << "I love it" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long n, j;
int main() {
cin >> n;
for (j = 1; j <= n; j++) {
if (j % 2 == 0) {
cout << "I love";
}
if (j % 2 != 0) {
cout << "I hate";
}
if (j == n) {
cout << " it";
break;
}
cout << " that ";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
template <typename T>
std::vector<std::vector<std::vector<T>>> make_3d_vector(long long z,
long long y,
long long x,
T value = T{}) {
return std::vector<std::vector<std::vector<T>>>(
z, std::vector<std::vector<T>>(y, std::vector<T>(x, value)));
}
template <typename T>
std::vector<std::vector<T>> make_2d_vector(long long z, long long y,
T value = T{}) {
return std::vector<std::vector<T>>(z, std::vector<T>(y, value));
}
template <typename T>
std::vector<T> make_1d_vector(long long z, T value = T{}) {
return std::vector<T>(z, value);
}
void solve() {
long long n;
cin >> n;
for (long long i = 1; i < n; i++) {
if (i % 2)
cout << "I hate that ";
else
cout << "I love that ";
}
if (n % 2)
cout << "I hate it";
else
cout << "I love it";
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long test = 1;
while (test--) {
solve();
cout << "\n";
}
cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 == 1)
cout << "I hate ";
else
cout << "I love ";
if (i == n)
cout << "it";
else
cout << "that ";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string s1 = "I hate it";
string s2 = "I love it";
int n;
cin >> n;
if (n == 1) {
cout << s1 << endl;
return 0;
}
if (n == 2) {
cout << "I hate that " << s2 << endl;
return 0;
}
for (int i = 0; i < n - 1; i++) {
if (i % 2 == 0)
cout << "I hate that ";
else
cout << "I love that ";
}
if (n % 2)
cout << s1 << endl;
else
cout << s2 << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a = 0;
cout << "I hate ";
n--;
while (n--) {
cout << "that ";
if (a) {
cout << "I hate ";
a = 0;
} else {
cout << "I love ";
a = 1;
}
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a, i;
while (cin >> a) {
for (i = 1; i <= a; i++) {
if ((i % 2) != 0)
cout << "I hate ";
else
cout << "I love ";
if (i == a)
cout << "it" << endl;
else
cout << "that ";
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, n;
cin >> n;
if (n == 1) {
printf("I hate it");
}
if (n == 2) {
printf("I hate that I love it");
}
if (n > 2 && n % 2 == 0) {
printf("I ");
for (i = 1; i < n; i++) {
if (i % 2 != 0) {
printf("hate that I ");
} else {
printf("love that I ");
}
}
printf("love it");
}
if (n > 2 && n % 2 != 0) {
printf("I ");
for (i = 1; i < n; i++) {
if (i % 2 != 0) {
printf("hate that I ");
} else {
printf("love that I ");
}
}
printf("hate it");
}
}
|
#include <bits/stdc++.h>
int main() {
int n, i;
scanf("%d", &n);
for (i = 1; i < n; i++) {
if (i % 2 == 1)
printf("I hate that ");
else
printf("I love that ");
}
if (n % 2 == 1)
printf("I hate it\n ");
else if (n % 2 == 0)
printf("I love it\n ");
}
|
#include <bits/stdc++.h>
using namespace std;
struct debugger {
template <typename T>
debugger& operator,(const T v) {
cerr << v << " ";
return *this;
}
} dbg;
int main() {
int n;
cin >> n;
for (int i = 1; i < n; ++i) {
if (i & 1) {
cout << "I hate that ";
} else {
cout << "I love that ";
}
}
if (n & 1) {
cout << "I hate it"
<< "\n";
} else {
cout << "I love it"
<< "\n";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string hate = "I hate";
string love = "I love";
int n;
cin >> n;
if (n == 1) {
cout << hate << " it" << endl;
exit(0);
}
if (n == 2) {
cout << hate << " that " << love << " it" << endl;
exit(0);
}
for (int i = 1; i < n; i++) {
if (i % 2)
cout << hate << " that ";
else
cout << love << " that ";
}
if (n % 2)
cout << hate << " it" << endl;
else
cout << love << " it";
}
|
#include <bits/stdc++.h>
int main(void) {
int n, i;
scanf("%d", &n);
for (i = 1; i <= n; i++) {
if ((i % 2) != 0) {
printf("I hate");
if (i == n) {
printf(" it");
break;
}
} else {
printf("I love");
if (i == n) {
printf(" it");
break;
}
}
printf(" that ");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int a;
cin >> a;
for (int i = 1; i <= a; i++) {
if (i % 2 == 1) {
cout << "I hate ";
} else {
cout << "I love ";
}
if (i < a) {
cout << "that ";
} else {
cout << "it ";
}
}
return 0;
}
|
#include <bits/stdc++.h>
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(NULL);
std::cout.tie(NULL);
int n;
std::cin >> n;
std::string s1 = "I hate that ";
std::string s2 = "I love that ";
std::string s3 = "I hate it";
std::string s4 = "I love it";
if (n == 1) {
std::cout << "I hate it" << std::endl;
} else {
std::string s = s1;
int i = 2;
while (i <= n) {
if (i % 2 == 0 && i != n) {
s += s2;
} else if (i % 2 != 0 && i != n) {
s += s1;
} else if (i % 2 == 0 && i == n) {
s += s4;
} else if (i % 2 != 0 && i == n) {
s += s3;
}
++i;
}
std::cout << s << std::endl;
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, c = 0;
cin >> n;
cout << "I hate ";
c--;
for (int i = 1; i < n; i++) {
cout << "that ";
if (c == 0) {
cout << "I hate ";
c--;
} else {
cout << "I love ";
c++;
}
}
cout << "it ";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string a = "I hate it", b = "I love it", c = "I love that ",
d = "I hate that ", s = "";
if (n == 1) {
cout << a;
return 0;
}
for (int i = 1; i <= n - 1; i++) {
if (i % 2 != 0) s += d;
if (i % 2 == 0) s += c;
}
if (n % 2 != 0) s += a;
if (n % 2 == 0) s += b;
cout << s;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
cout << "I ";
if (i % 2 != 0)
cout << "hate ";
else
cout << "love ";
if (i != n) cout << "that ";
}
cout << "it "
<< "\n";
}
|
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
cout << "I hate ";
for (int i = 2; i <= n; i++) {
if (i % 2 == 0) {
cout << "that I love ";
} else {
cout << "that I hate ";
}
}
cout << "it";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string love = "I love ";
string hate = "I hate ";
cout << hate;
for (int i = 1; i < n; i++) {
cout << "that ";
if (i % 2 != 0)
cout << love;
else
cout << hate;
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s[2] = {"I hate it", " I love it"};
string s_[2] = {"I hate that", " I love that"};
string tmp = "";
for (int i = 0; i < n; ++i) {
if (i % 2 == 0) {
if (n > 1 && i < n - 1)
tmp += s_[0];
else if (n == 1 || i == n - 1) {
tmp += s[0];
}
} else {
if (n > 1 && i < n - 1) {
tmp += s_[1];
if (i < n - 1) tmp += ' ';
} else if (n == 1 || i == n - 1) {
tmp += s[1];
}
}
}
cout << tmp << '\n';
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
int i;
bool check = false, check1 = false;
if (n != 0) {
for (i = 1; i <= n; i++) {
if (i % 2 == 1) {
if (check1) {
printf("that ");
}
printf("I hate ");
check = true;
check1 = false;
}
if (i % 2 == 0) {
if (check) {
printf("that ");
}
printf("I love ");
check = false;
check1 = true;
}
}
printf("it");
}
getchar();
getchar();
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string s1 = "I love", s2 = "I hate";
for (int i = 1; i <= n; i++) {
if (i % 2 == 0) {
cout << s1 << " ";
} else {
cout << s2 << " ";
}
if (i != n) {
cout << "that ";
}
}
cout << "it" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
const int N = 10005;
const int mod = 1e9 + 7;
int main() {
int n;
while (cin >> n) {
int flag = 0;
while (n--) {
if (flag % 2 == 0) {
cout << "I hate";
} else {
cout << "I love";
}
if (n != 0) {
cout << " that ";
} else {
cout << " it";
}
flag++;
}
cout << endl;
}
}
|
#include <bits/stdc++.h>
int main() {
int n;
scanf("%d", &n);
for (int i = 1; i <= n; i++) {
if (i == n && i % 2 != 0)
printf("I hate it\n");
else if (i == n && i % 2 == 0)
printf("I love it\n");
else if (i % 2 != 0 && i != n)
printf("I hate that ");
else if (i % 2 == 0 && i != n)
printf("I love that ");
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int i, n;
string a;
int main() {
cin >> n;
a = a + "I hate";
if (n == 1)
cout << a + " it";
else {
for (i = 1; i < n; i++) {
if (i % 2 != 0)
a = a + " that I love";
else
a = a + " that I hate";
}
cout << a + " it";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
string m1 = "I hate ", m2 = " I love ";
cin >> n;
while (n) {
ss:
cout << m1;
n--;
if (n == 0) {
cout << "it";
break;
}
cout << "that" << m2;
n--;
if (n == 0) {
cout << "it";
break;
} else {
cout << "that ";
goto ss;
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, N;
string feelings = "";
cin >> n;
N = n;
if (n == 1)
feelings = "I hate it";
else
for (int i = 1; i < n; i) {
feelings += "I hate that ";
n--;
if (n > 1) {
feelings += "I love that ";
n--;
}
while (n == 1) {
if (N % 2 != 0) feelings += "I hate it";
if (N % 2 == 0) feelings += "I love it";
n--;
}
}
cout << feelings;
return 0;
}
|
#include <bits/stdc++.h>
int main(void) {
int t;
scanf("%d", &t);
int i;
for (i = 1; i <= t; ++i) {
if (i % 2) {
printf("I hate ");
if (i == t) {
printf("it");
} else {
printf("that ");
}
} else {
printf("I love ");
if (i == t) {
printf("it");
} else {
printf("that ");
}
}
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int num, i;
cin >> num;
for (i = 0; i < num; i++) {
if (i % 2 == 0 && i != num - 1)
cout << "I hate that ";
else if (i % 2 == 0 && i == num - 1)
cout << "I hate it";
if (i % 2 != 0 && i != num - 1)
cout << "I love that ";
else if (i % 2 != 0 && i == num - 1)
cout << "I love it";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 2 == 0) {
while (n != 0) {
if (n % 2 == 0) {
cout << "I hate";
n--;
}
if (n % 2 != 0) {
cout << " that I love";
n--;
}
if (n != 0) cout << " that ";
}
cout << " it";
}
if (n % 2 != 0) {
while (n != 0) {
if (n % 2 != 0) {
cout << "I hate";
n--;
}
if (n % 2 == 0 && n != 0) {
cout << " that I love";
n--;
}
if (n != 0) cout << " that ";
}
cout << " it";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i > 1) {
cout << "that"
<< " ";
}
if (i % 2 != 0) {
cout << "I hate";
}
if (i % 2 == 0) {
cout << "I love";
}
cout << " ";
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int i = 1;
while (i < n) {
if (i % 2 == 0) {
cout << "I love that ";
} else {
cout << "I hate that ";
}
i++;
}
if (n % 2 == 0) {
cout << "I love it";
} else {
cout << "I hate it";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i;
cin >> n;
for (i = 1; i < n; i++) {
if (i % 2 == 0) {
cout << "I love that"
<< " ";
} else {
cout << "I hate that"
<< " ";
}
}
if (n % 2 == 0)
cout << "I love it"
<< "\n";
else
cout << "I hate it"
<< "\n";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(void) {
cin.tie(0)->sync_with_stdio(false);
int n;
cin >> n;
string ans = "";
for (int i = 1; i <= n; i++) {
if (i % 2 && i == n) {
ans.append("I hate it");
} else if (i == n && i % 2 == 0) {
ans.append("I love it");
} else if (i % 2) {
ans.append("I hate that ");
} else if (i % 2 == 0) {
ans.append("I love that ");
}
}
cout << ans << '\n';
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
unordered_map<int, string> hulk_feelings;
hulk_feelings[1] = "I hate";
hulk_feelings[2] = "I love";
string connection_word = "that";
string end_word = "it";
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i > 1) cout << connection_word + " ";
if (!(i % 2))
cout << hulk_feelings[2] + " ";
else
cout << hulk_feelings[1] + " ";
}
cout << end_word;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 == 0)
cout << "I love ";
else
cout << "I hate ";
if (i == n)
cout << "it ";
else
cout << "that ";
}
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long int max1(long long int a, long long int b) { return (a > b ? a : b); }
long long int min1(long long int a, long long int b) { return (a > b ? b : a); }
long long int gcd(long long int a, long long int b) {
if (a == 0)
return b;
else {
return gcd(b % a, a);
}
}
int main() {
int n;
string s1 = "I hate";
string s2 = "I love";
cin >> n;
int state = 0;
int c = 1;
for (int i = 0; i < n; i++) {
if (state == 0) {
cout << s1;
if ((n - c) >= 1) cout << " that ";
state = 1;
c++;
} else if (state == 1) {
cout << s2;
if ((n - c) >= 1) cout << " that ";
state = 0;
c++;
}
}
cout << " it" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int i, n;
cin >> n;
for (i = 1; i <= n; ++i) {
if (i % 2 == 0) {
cout << "I love";
} else {
cout << "I hate";
}
if (i == n) {
cout << " it";
} else {
cout << " that ";
}
}
return 0;
}
|
#include <bits/stdc++.h>
int main() {
unsigned int n, i;
scanf("%u", &n);
printf("I hate");
for (i = 1; i < n; i++) {
if (i % 2 == 1)
printf(" that I love");
else
printf(" that I hate");
}
printf(" it");
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i == n) {
if (i % 2 == 0) {
cout << " I love it";
} else {
cout << " I hate it";
}
} else {
if (i % 2 == 0) {
cout << " I love that";
} else {
cout << " I hate that";
}
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string k;
for (int i = 0; i < n; i++) {
if (i % 2 == 1) k = "love";
if (i % 2 == 0) k = "hate";
if (i == n - 1) cout << "I " << k << " it";
if (i < n - 1) cout << "I " << k << " that ";
}
}
|
#include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
for (int i = 1; i < n + 1; ++i) {
if (i > 1) {
std::cout << "that ";
}
if (i % 2 == 0) {
std::cout << "I love ";
} else {
std::cout << "I hate ";
}
}
std::cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
if (n % 2 == 0) {
for (int i = n - 1; i > 0; i = i - 2) {
cout << "I hate that"
<< " ";
if (i > 1) {
cout << "I love that"
<< " ";
}
}
cout << "I love it";
} else {
for (int i = n - 1; i > 0; i = i - 2) {
cout << "I hate that"
<< " ";
if (i > 0) {
cout << "I love that"
<< " ";
}
}
cout << "I hate it";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string str1, str2, str3, str4, str;
str1 = "I hate ";
str2 = "I love ";
str3 = "that ";
str4 = "it\n";
str = "";
str.append(str1);
int i;
for (i = 2; i <= n; ++i) {
str.append(str3);
if (i % 2 == 0)
str.append(str2);
else if (i % 2 == 1)
str.append(str1);
}
str.append(str4);
cout << str;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
string a = "I hate ", b = "I love ";
int n;
while (cin >> n) {
while (n--) {
cout << a;
if (n == 0) {
cout << "it" << endl;
break;
} else {
cout << "that ";
}
cout << b;
n--;
if (n == 0) {
cout << "it" << endl;
break;
} else {
cout << "that ";
}
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n;
cin >> n;
string s, t = "I hate that", k = "I love that";
for (int i = 1; i <= n; i++) {
if (i % 2 != 0)
s = s + t;
else
s = s + k;
if (i < n) s = s + ' ';
}
for (int i = 1; i < 5; i++) {
s.pop_back();
}
s.push_back('i');
s.push_back('t');
cout << s;
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int a, i;
while (scanf("%d", &a) != EOF) {
for (i = 1; i <= a; i++) {
if (i % 2)
printf("I hate");
else
printf("I love");
if (i == a)
printf(" it\n");
else
printf(" that ");
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main(void) {
int n;
cin >> n;
string s1 = "I love", s2 = "I hate";
for (int i = 0; i < n; i++) {
if (i & 1) {
cout << s1 << " ";
} else {
cout << s2 << " ";
}
if (i != n - 1) cout << "that ";
}
cout << "it" << endl;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i < n; i++) {
if (i % 2 == 1) {
cout << "I hate that ";
} else {
cout << "I love that ";
}
}
if (n % 2 == 0) {
cout << "I love it";
} else
cout << "I hate it ";
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 0; i < n; ++i) {
if (i % 2 == 0)
cout << "I hate ";
else
cout << "I love ";
if (i != n - 1)
cout << "that ";
else
cout << "it ";
}
}
|
#include <bits/stdc++.h>
using namespace std;
int a;
int main() {
cin >> a;
for (int i = 0; i < a; i++) {
if (i % 2 == 0) {
cout << "I hate ";
} else {
cout << "I love ";
}
if (i != a - 1) {
cout << "that ";
} else {
cout << "it ";
}
}
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, i = 0;
cin >> n;
cout << "I hate ";
for (i; i < n - 1; i++) {
if (i % 2 == 0) {
cout << "that I love ";
} else
cout << "that I hate ";
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
for (int i = 1; i <= n; i++) {
if (i % 2 == 1)
cout << "I hate";
else
cout << "I love";
if (i == n)
cout << " it";
else
cout << " that ";
}
cout << endl;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
string str = "";
for (int i = 0; i < n; i++) {
if (i & 1)
str += "I love";
else
str += "I hate";
if (i != n - 1) str += " that ";
}
str += " it";
cout << str;
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
cout << "I hate ";
for (int i = 2; i <= n; i++) {
if (i % 2 == 0)
cout << "that I love ";
else
cout << "that I hate ";
}
cout << "it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
long long n, i;
int main() {
cin >> n;
if (n == 1) cout << "I hate it";
if (n == 2) cout << "I hate that I love it";
if (n % 2 and n > 2) {
for (i = 0; i < n / 2; i++) cout << "I hate that I love that ";
}
if (n % 2 == 0 and n > 2) {
for (i = 0; i < n / 2 - 1; i++) cout << "I hate that I love that ";
cout << "I hate that";
}
if (n % 2 and n > 2) cout << "I hate it";
if (n % 2 == 0 and n > 2) cout << " I love it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
string whatSay(int n) {}
int main() {
int n;
cin >> n;
string str = "";
for (int i = 1; i <= n; i++) {
if (i % 2 == 0) {
str += "I love ";
} else {
str += "I hate ";
}
if (i == n) {
str += "it";
} else {
str += "that ";
}
}
cout << str;
return 0;
}
|
#include <bits/stdc++.h>
int main() {
int n;
std::cin >> n;
for (int i = 1; i < n; ++i)
if (i % 2 == 1)
std::cout << "I hate that ";
else
std::cout << "I love that ";
if (n % 2 == 1)
std::cout << "I hate it";
else
std::cout << "I love it";
return 0;
}
|
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
scanf("%d", &n);
bool tht = false;
if (n % 2 == 0) tht = true;
for (int i = 1; i <= n / 2; i++) {
if (tht && i == n / 2)
printf("I hate that I love it");
else
printf("I hate that I love that ");
}
if (!tht) printf("I hate it ");
}
void readInput() {
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
void closeFiles() {
fclose(stdin);
fclose(stdout);
}
int main() { solve(); }
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.