結果

問題 No.1168 Digit Sum Sequence
ユーザー 👑 CleyL
提出日時 2021-10-09 10:51:51
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 264 bytes
コンパイル時間 633 ms
コンパイル使用メモリ 67,912 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-07-26 12:54:18
合計ジャッジ時間 2,003 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    string s;cin>>s;
    for(int i = 0; 2 > i; i++){
        int nw = 0;
        for(int j = 0; s.size() > j; j++){
            nw += s[j]-'0';
        }
        s = to_string(nw);
    }
    cout << s << endl;
}
0