結果

問題 No.188 HAPPY DAY
ユーザー owata781owata781
提出日時 2017-05-16 19:41:22
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 323 bytes
コンパイル時間 1,182 ms
コンパイル使用メモリ 51,468 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-29 22:34:11
合計ジャッジ時間 780 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:47: warning: ‘count’ may be used uninitialized in this function [-Wmaybe-uninitialized]
             if(m == (d % 10) + (d / 10)) count++;
                                          ~~~~~^~

ソースコード

diff #

#include <iostream>
using namespace std;
int main() {
    int count;
    int days[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for(int m = 1; m <= 12; m++){
        for(int d = 1; d <= days[m-1]; d++){
            if(m == (d % 10) + (d / 10)) count++;
        }
    }
    cout << count << endl;
    return 0;
}
0