1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
#include <iostream> #include <string> using namespace std; string str[105]; string song[16]={"Happy", "birthday", "to", "you", "Happy", "birthday", "to", "you", "Happy", "birthday", "to", "Rujia", "Happy", "birthday", "to", "you",}; int main() { int n; int i=0; cin>>n; int org = n; while(n--) { cin>>str[i++]; } n=org; if(org<=16) { for(int j=0;j<16;j++) { cout<<str[j%i]<<": "; cout<<song[j]<<"\n"; } } else { int Last; for(int j=0;j<i;j++) { cout<<str[j]<<": "; cout<<song[j%16]<<"\n"; Last = j%16;//song[ } if(Last!=15) { int l = 0; for(int k=Last+1;k<16;k++) { cout<<str[l++]<<": "; cout<<song[k]<<"\n"; } } } // cin>>n; return 0; } |