Submission

Status:
[PPPP][PPPPPPPPPPP]

Score: 100

User: Nathlol2

Problemset: ดูวีทูปเบอร์

Language: c

Time: 0.001 second

Submitted On: 2024-09-25 13:11:29

#include <stdio.h>

int main(){
    int x, y;
    int a, b;
    scanf("%d %d %d %d", &x, &y, &a, &b);
    int cnt = 0;
    int day[12] = {31,28,31,30,31,30,31,31,30,31,30,31};
    if(y == b){
        cnt = (a - x) * 3;
        cnt = cnt + 3;
        printf("%d", cnt);
        return 0;
    }
    for(int i = x;i<day[y - 1];i++){
        cnt = cnt + 3;
    }
    for(int i = y + 1;i<b;i++){
        if(day[i - 1] == 31){
            cnt = cnt + 93;
        }else if(day[i - 1] == 30){
            cnt = cnt + 90;
        }else {
            cnt = cnt + 84;
        }
    }
    for(int i = 1;i<=a;i++){
        cnt = cnt + 3;
    }
    cnt = cnt + 3;
    printf("%d", cnt);
}