結果
| 問題 |
No.1168 Digit Sum Sequence
|
| コンテスト | |
| ユーザー |
遭難者
|
| 提出日時 | 2020-10-13 11:40:00 |
| 言語 | Java (openjdk 23) |
| 結果 |
AC
|
| 実行時間 | 139 ms / 2,000 ms |
| コード長 | 402 bytes |
| コンパイル時間 | 2,210 ms |
| コンパイル使用メモリ | 74,888 KB |
| 実行使用メモリ | 41,544 KB |
| 最終ジャッジ日時 | 2024-07-20 18:24:27 |
| 合計ジャッジ時間 | 7,449 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter ou = new PrintWriter(System.out);
int n = Integer.parseInt(sc.next());
for(int i = 0 ; i < 100 ; i++){
int s = 0 , cl = n;
while(cl != 0){
s += cl % 10;
cl /= 10;
}
n = s;
}
ou.println(n);
ou.flush();
sc.close();
}
}
遭難者