結果
| 問題 | No.656 ゴルフ |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-08 18:28:50 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 373 bytes |
| 記録 | |
| コンパイル時間 | 459 ms |
| コンパイル使用メモリ | 71,152 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-29 14:11:19 |
| 合計ジャッジ時間 | 1,122 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 6 |
ソースコード
#include<iostream>
#include<string>
using namespace std;
int ctoi(char c){
if(c >='0' && c<='9'){
return c-'0';
}
return -1;
}
int main()
{
string str;
cin>>str;
int score = 0;
for(int i=0;i<str.length();i++){
score += ctoi(str[i]);
if(str[i]=='0'){
score+=10;
}
}
cout<<score;
return 0;
}