結果
| 問題 | 
                            No.188 HAPPY DAY
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ingredient
                         | 
                    
| 提出日時 | 2019-07-08 11:26:19 | 
| 言語 | C++11(廃止可能性あり)  (gcc 13.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 266 bytes | 
| コンパイル時間 | 552 ms | 
| コンパイル使用メモリ | 54,816 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-08 01:54:38 | 
| 合計ジャッジ時間 | 1,157 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | WA * 1 | 
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:33: warning: ‘ans’ may be used uninitialized in this function [-Wmaybe-uninitialized]
    8 |             if(i==j/10+j%10) ans++;
      |                              ~~~^~
            
            ソースコード
#include<iostream>
using namespace std;
int main(){
    int i,j,ans;
    int c[13]={0,31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    for(i=1;i<=12;i++){
        for(j=1;j<=c[i];j++){
            if(i==j/10+j%10) ans++;
        }
    }
    cout << ans <<endl;
}
            
            
            
        
            
ingredient