A. Hulk
time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output
题意:
根据输入n的大小循环I hate that I love that I hate it...
自古PA多水题,判断奇偶然后做输出就好了。
附AC代码:
1 #include<bits/stdc++.h> 2 using namespace std; 3 int main(){ 4 string s1="I hate that ",s2="I love that ",s4="I love it",s3="I hate it"; 5 int n,ans=0; 6 cin>>n; 7 for(int i=1;i<n;i++){ 8 if(ans==0){ 9 cout<<s1; 10 ans=1; 11 continue; 12 } 13 else{ 14 cout<<s2; 15 ans=0; 16 continue; 17 } 18 19 } 20 if(n%2==1) 21 cout<<s3; 22 else 23 cout<<s4; 24 return 0; 25 }