-
Notifications
You must be signed in to change notification settings - Fork 0
/
12554_A_Special_Happy Birthday.cpp
45 lines (43 loc) · 1.1 KB
/
12554_A_Special_Happy Birthday.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
/*##### Md. Walid Bin khalid Aunkon #####*/
/*##### Sr. Software Engineer (Unity) #####*/
/*##### Email: [email protected] #####*/
/*##### Mobile No: +88-01916-492926 #####*/
#include <stdio.h>
int main()
{
int n;
scanf("%d", &n);
char name[n][100];
char song[16][9] = {"Happy", "birthday", "to", "you", "Happy", "birthday", "to", "you", "Happy", "birthday", "to", "Rujia", "Happy", "birthday", "to", "you"};
for (int i = 0; i < n; i++)
{
scanf("%s", &name[i]);
}
int i = 0, j = 0;
if (n < 16)
{
for (i = 0; i < 16; i++)
{
printf("%s: %s\n", name[j++], song[i]);
if (j == n)
j = 0;
}
}
else
{
for (i = 0; i <n; i++)
{
printf("%s: %s\n", name[i], song[j++]);
if (j == 16)
j = 0;
}
i=0;
for (j; j < 16; j++)
{
printf("%s: %s\n", name[i++], song[j]);
if (i == n)
i = 0;
}
}
return 0;
}