結果
問題 | No.656 ゴルフ |
ユーザー |
|
提出日時 | 2018-03-02 23:22:05 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 65,684 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-22 10:50:56 |
合計ジャッジ時間 | 1,352 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 6 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { string input; cin >> input; int sum=0; for (string::iterator it=input.begin(); it!=input.end(); ++it){ int num = (int)(*it) - 48; if (num == 0){ sum += 10; } else{ sum += num; } } cout << sum << endl; return 0; }