結果

問題 No.188 HAPPY DAY
ユーザー kai10920kai10920
提出日時 2022-12-15 18:26:06
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 498 bytes
コンパイル時間 316 ms
コンパイル使用メモリ 32,768 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-04-26 18:52:13
合計ジャッジ時間 709 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<stdio.h>



int daysBy(int month) {
    if(month==1||month==3||month==5||month==7||month==8||month==10||month==12){
        return 31;
    }
    if(month==2){
        return 28;
    }
    return 30;
}

int main(){
    int count;
    count=0;
    for(int month=1;month<=12;month++){
        for(int day=1;day<=daysBy(month);day++){
            int a;
            a=(day/10)+(day%10);
            if(month==a){
                count++;
            }
        }
    }
    printf("%d",count);
}
0