A. Hulk

题意是给你一个n 输出一个英文字符串,找下规律就发现 

当(i!=n&&i%2==1) 输出的是 I hate that (注意大写)

当(i!=n&&i%2==0) 输出的是 I love that (注意大写)

当(i==n&&i%2==1) 输出的是 I love it (注意大写)

当(i==n&&i%2==0) 输出的是 I love it (注意大写)

注意有空格;

#include<bits/stdc++.h>
#define int long long
#define MAX(a,b,c) max(a,max(b,c))
#define MIN(a,b,c) min(a,min(b,c))
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef long long LL;
typedef unsigned long long ull;
typedef unsigned long long uLL;
using namespace std;
const int maxn=1e5+10;
const int INF=0x3f3f3f3f;
int32_t 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==1) cout<<"I hate it"<<endl;
    else       cout<<"I love it"<<endl;
}
A.cpp

相关文章:

  • 2022-12-23
  • 2021-06-16
  • 2021-05-30
  • 2022-12-23
  • 2021-12-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-03
  • 2021-07-24
  • 2021-10-22
  • 2022-12-23
相关资源
相似解决方案