結果
問題 |
No.1168 Digit Sum Sequence
|
ユーザー |
![]() |
提出日時 | 2022-05-14 12:34:16 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 52 ms / 2,000 ms |
コード長 | 398 bytes |
コンパイル時間 | 2,312 ms |
コンパイル使用メモリ | 76,132 KB |
実行使用メモリ | 37,536 KB |
最終ジャッジ日時 | 2024-07-22 21:17:41 |
合計ジャッジ時間 | 5,265 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 |
ソースコード
import java.io.*; public class Main { public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); String line=br.readLine(); while(line.length()>1){ int sum=0; for(int i=0;i<line.length();i++){ sum+=(int)line.charAt(i)-48; } line=""+sum; } System.out.println(line); } }