結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
y61mpnl
|
| 提出日時 | 2021-02-20 20:20:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 195 bytes |
| コンパイル時間 | 1,893 ms |
| コンパイル使用メモリ | 190,600 KB |
| 最終ジャッジ日時 | 2025-01-19 02:46:58 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:5:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%d", &a);
| ~~~~~^~~~~~~~~~
ソースコード
#include<bits/stdc++.h>
int main(){
int a;
scanf("%d", &a);
for(int i=0; i<99; i++){
int tmp = 0;
while(a){
tmp += a%10;
a /= 10;
}
a = tmp;
}
printf("%d\n", a);
return 0;
}
y61mpnl