結果
| 問題 | 
                            No.289 数字を全て足そう
                             | 
                    
| コンテスト | |
| ユーザー | 
                             SAIKI_R_A
                         | 
                    
| 提出日時 | 2019-07-11 17:43:07 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 3 ms / 1,000 ms | 
| コード長 | 275 bytes | 
| コンパイル時間 | 605 ms | 
| コンパイル使用メモリ | 64,000 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-08 00:12:34 | 
| 合計ジャッジ時間 | 1,349 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 21 | 
ソースコード
#include<iostream>
#include<string>
using namespace std;
int main(void)
{
    string s;
    cin>>s;
    
    int ans=0;
    
    for(int i=0;i<s.size();i++)
    {
        if('1'<=s[i]&&s[i]<='9')
        {
            ans+=s[i]-'1'+1;
        }
    }
    cout<<ans<<endl;
}
            
            
            
        
            
SAIKI_R_A