結果

問題 No.188 HAPPY DAY
ユーザー neeetneeet
提出日時 2017-06-14 15:31:27
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 0 ms / 1,000 ms
コード長 834 bytes
コンパイル時間 146 ms
コンパイル使用メモリ 28,884 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-08-29 22:35:22
合計ジャッジ時間 605 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <stdio.h>

int main(void)
{
        char month, ten, one, count = 0;
        char end[12] = {31,28,31,30,31,30,31,31,30,31,30,31};

        for(month = 1; month <= 12; month++){   
                one = 1;
                ten = 0;
                while(end[month - 1] >= (ten * 10) + one){
                        if(one == 10){
                                one = 0;
                                ten++;
                        }
                        if(month > ten + one){
                                one++;
                                continue;
                        }
                        else if(month == ten + one)
                                count++;
                        ten++;
                        one = 0;
                }
        }
        printf("%d\n", count);

        return 0;
}
0