結果

問題 No.188 HAPPY DAY
ユーザー r2en_r2en_
提出日時 2017-02-27 01:22:51
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1 ms / 1,000 ms
コード長 650 bytes
コンパイル時間 340 ms
コンパイル使用メモリ 51,792 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-29 22:27:07
合計ジャッジ時間 823 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;

int calc(int x,int y){
    int sum = 0;
    sum = y/10 + y%10;
    if(x == sum){
        return 1;
    }
    return 0;
}

int main(void){
    int x,y;
    int count = 0;
    for(x=1;x<=12;x++){
        if(x==2){
            for(y=1;y<=29;y++){
                if(calc(x,y) == 1){count++;}
            }
        }else if(x==4 || x==6 || x==9 || x==11){
            for(y=1;y<=30;y++){
                if(calc(x,y) == 1){count++;}
            }
        }else{
            for(y=1;y<=31;y++){
                if(calc(x,y) == 1){count++;}
            }
        }
    }
    cout << count << "\n";
    return(0);
}
0