fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n;
  6. cin >>n;
  7. for (int i=1; i<=n;i++){
  8. if (i==n){
  9. if (i%2==1){
  10. cout << "I hate it";
  11. }
  12. else {
  13. cout << "I love it";
  14. }
  15. }
  16. else if (i%2==1){
  17. cout << "I hate that ";
  18. }
  19. else {
  20. cout << "I love that ";
  21. }
  22.  
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0.01s 5548KB
stdin
8
stdout
I hate that I love that I hate that I love that I hate that I love that I hate that I love it