結果

問題 No.188 HAPPY DAY
ユーザー funakoshifunakoshi
提出日時 2019-08-19 11:24:05
言語 C
(gcc 12.3.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 1,447 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 31,616 KB
実行使用メモリ 6,812 KB
最終ジャッジ日時 2024-04-20 04:45:08
合計ジャッジ時間 546 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
    int month=1,hdaycnt=0;
    while (month<13)
    {
        if(month==1||month==3||month==5||month==7||month==8||month==10||month==12)
        {
            for(int i=0;i<=3;i++)
            {
                for(int j=0;j<=9;j++)
                {
                    if(i==3&&j>1)
                    {
                        break;
                    }
                    if(month==i+j)
                    {
                        hdaycnt++;
                    }
                }
            }
            month++;
        }
        else if (month==4||month==6||month==9||month==11)
        {
            for(int i=0;i<=3;i++)
            {
                for(int j=0;j<=9;j++)
                {
                    if(i==3&&j>0)
                    {
                        break;
                    }
                    if(month==i+j)
                    {
                        hdaycnt++;
                    }
                }
            }
            month++;
        }
        else if(month==2)
        {
            for(int i=0;i<=2;i++)
            {
                for(int j=0;j<=9;j++)
                {
                    if(month==i+j)
                    {
                        hdaycnt++;
                    }
                }
            }
            month++;
        }
    }
    printf("%d",hdaycnt);
    
}
0