結果
| 問題 |
No.188 HAPPY DAY
|
| コンテスト | |
| ユーザー |
sshckk
|
| 提出日時 | 2020-01-13 23:57:39 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 565 bytes |
| コンパイル時間 | 1,699 ms |
| コンパイル使用メモリ | 165,008 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-12-23 06:17:15 |
| 合計ジャッジ時間 | 1,867 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 1 |
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:18:21: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
18 | ans += 1;
| ~~~~^~~~
main.cpp:7:9: note: 'ans' was declared here
7 | int ans;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int month, day;
int lim;
int ans;
for (month = 1; month <= 12; month++) {
if (month != 2 | month != 4 | month != 6 | month != 9 | month != 11) {
lim = 31;
}
else{
lim = 30;
}
for (day = 1; day <= lim; day++) {
if (month == ((day / 10) + (day%10))) {
ans += 1;
}
else{
cout << "\n";
}
}
}
cout << ans <<"\n";
return 0;
}
sshckk