Submission
Status:
[PPP-][PPPPPPPPPPP]
Score: 70
User: Nathlol
Problemset: ดูวีทูปเบอร์
Language: c
Time: 0.001 second
Submitted On: 2024-09-23 15:23:09
#include <stdio.h>
int main(){
int x, y;
int a, b;
scanf("%d %d\n%d %d", &x, &y, &a, &b);
int z[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
int day = 0;
if(y == b){
day = a - x;
day = day * 3;
day = day + 3;
printf("%d", day);
return 0;
}
int m = z[y - 1] - x;
int s = 0;
for(int i = y + 1;i<b - 1;i++){
if(i <= b - 1){
break;
}
s = s + z[i - 1];
}
day = day + a;
day = day + m + s;
int cnt = day * 3;
cnt = cnt + 3;
printf("%d", cnt);
}