-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path12554 - A Special "Happy Birthday" Song!!!.cpp
64 lines (59 loc) · 1.43 KB
/
12554 - A Special "Happy Birthday" Song!!!.cpp
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
54
55
56
57
58
59
60
61
62
63
64
#include <bits/stdc++.h>
using namespace std;
string s[19] = {"Happy", "birthday", "to" , "you" , "Happy" , "birthday" ,"to" ,"you", "Happy", "birthday", "to" , "Rujia", "Happy" ,"birthday", "to", "you"};
int main()
{
int n;
vector <string> vs;
while(cin >> n)
{
for(int i = 0; i < n; i++)
{
string s;
cin >> s;
vs.push_back(s);
}
if(n == 16)
{
for(int i = 0; i < n; i++)
{
cout<< vs[i] <<": " << s[i] << endl;
}
continue;
}
else if (n < 16)
{
for(int i = 0, j = 0; i < 16; i++, j++)
{
if(j == n)
j = 0;
cout<< vs[j] << ": " << s[i] << endl;
}
}
else if (n % 16 == 0)
{
for(int i = 0, j = 0; i < n; i++, j++)
{
if(j == 16)
j = 0;
cout<< vs[i] << ": " << s[j] << endl;
}
}
else
{
int p = n / 16;
int x = 16 + 16 * p;
int a = 0, b = 0;
for(int i = 0; i < x; i++)
{
if(a == n)
a = 0;
if(b == 16)
b = 0;
cout<<vs[a] << ": " << s[b] << endl;
a++;
b++;
}
}
}
}