結果

問題 No.721 Die tertia (ディエ・テルツィア)
ユーザー Akihisa.KAkihisa.K
提出日時 2018-11-03 23:35:12
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 943 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 28,608 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-13 03:08:52
合計ジャッジ時間 1,063 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 0 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 0 ms
4,376 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 0 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,380 KB
testcase_11 AC 0 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 0 ms
4,376 KB
testcase_15 AC 0 ms
4,380 KB
testcase_16 AC 0 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>

int main(void){
    int year,month,day=0;
    
    scanf("%d/%d/%d",&year,&month,&day);
    
    day+=2;
    if(month==4||month==6||month==9||month==11){
        if(day>=31){
            if(day==32)day=2;
            else day=1;
            month+=1;
        }   
    }else if(month==2){
        if(((year%4)==0&&(year%100)!=0)||(year%400)==0){
            if(day>=30){
                if(day==31)day=2;
                else day=1;
                month+=1;
            }
        }else{
            if(day>=29){
                if(day==30)day=2;
                else day=1;
                month+=1;
            }
        }
    }else{
        if(day>=32){
            if(day==33)day=2;
            else day=1;
            if(month==12){
                month=1;
                year+=1;
            }else{
                month+=1;
            }
        }
    }

    printf("%d/%02d/%02d\n",year,month,day);

    return 0;
}
0