結果

問題 No.188 HAPPY DAY
ユーザー xvfz57xvfz57
提出日時 2019-10-26 21:05:42
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 536 bytes
コンパイル時間 367 ms
コンパイル使用メモリ 51,376 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-12 19:41:25
合計ジャッジ時間 838 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

using namespace std;

int main(){
  int i;
  int maxday;
  int d1, d2;
  int count = 0;
  for (i = 1;i <= 12;i++){
      if (i==2){
        maxday = 28;
      }else if (i==1||i==3||i==5||i==7||i==8||i==10||i==12){
        maxday = 31;
      }else{
        maxday = 30;
      }
      for (int day = 1;day<=maxday;day++){
        d1 = day % 10;
        d2 = day / 10;

        if (i == (d1+d2)){
          count++;
          //cout << "month:"<<i<<" day:"<<day<<endl;
        }
      }
  }
  cout << count << endl;
}
0