-
Notifications
You must be signed in to change notification settings - Fork 0
/
2139.c
72 lines (72 loc) · 1.08 KB
/
2139.c
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
65
66
67
68
69
70
71
72
//2139
#include <stdio.h>
int main()
{
int m, d, f;
while(scanf("%d%d",&m,&d)!=EOF)
{
if(d==24 && m==12)
printf("E vespera de natal!\n");
else if(d>25 && m==12)
printf("Ja passou!\n");
else if(d==25 && m==12)
printf("E natal!\n");
else
{
printf("Faltam ");
switch(m)
{
case 1:
f = 360-d;
printf("%d ",f);
break;
case 2:
f = 329-d;
printf("%d ",f);
break;
case 3:
f = 300-d;
printf("%d ",f);
break;
case 4:
f = 269-d;
printf("%d ",f);
break;
case 5:
f = 239-d;
printf("%d ",f);
break;
case 6:
f = 208-d;
printf("%d ",f);
break;
case 7:
f = 178-d;
printf("%d ",f);
break;
case 8:
f = 147-d;
printf("%d ",f);
break;
case 9:
f = 116-d;
printf("%d ",f);
break;
case 10:
f = 86-d;
printf("%d ",f);
break;
case 11:
f = 55-d;
printf("%d ",f);
break;
case 12:
f = 25-d;
printf("%d ",f);
break;
}
printf("dias para o natal!\n");
}
}
return 0;
}