結果
| 問題 |
No.9011 数字を全て足そう(数字だけ)
|
| ユーザー |
T_Stream
|
| 提出日時 | 2020-04-13 21:58:29 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 177 bytes |
| コンパイル時間 | 1,957 ms |
| コンパイル使用メモリ | 192,900 KB |
| 最終ジャッジ日時 | 2025-01-09 18:13:52 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 23 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:10:20: warning: ‘ans’ may be used uninitialized [-Wmaybe-uninitialized]
10 | ans+=c;
| ~~~^~~
main.cpp:5:13: note: ‘ans’ was declared here
5 | int ans,i,c;
| ^~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int ans,i,c;
string s;
cin >> s;
for(i=0; i<s.size(); i++){
c=s[i]-'0';
ans+=c;
}
cout << ans;
return 0;
}
T_Stream