結果
問題 |
No.256 桁の数字を入れ替え (2)
|
ユーザー |
![]() |
提出日時 | 2015-08-06 15:59:25 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 489 bytes |
コンパイル時間 | 3,396 ms |
コンパイル使用メモリ | 75,112 KB |
実行使用メモリ | 58,636 KB |
最終ジャッジ日時 | 2024-07-18 03:37:18 |
合計ジャッジ時間 | 4,657 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 2 RE * 2 |
ソースコード
import java.util.Arrays; import java.util.Scanner; public class No256 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); int len = String.valueOf(n).length(); int[] arrayN = new int[len]; int d = (int)Math.pow(10, len-1); for(int i = 0; i < len; i++){ arrayN[i] = n / d; n = n % d; d = d / 10; } Arrays.sort(arrayN); for (int i = len - 1; i >=0; i--){ System.out.println(arrayN[i]); } } }