結果

問題 No.499 7進数変換
ユーザー Mcpu3Mcpu3
提出日時 2018-08-28 20:54:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 126 ms / 1,000 ms
コード長 292 bytes
コンパイル時間 1,957 ms
コンパイル使用メモリ 71,456 KB
実行使用メモリ 56,196 KB
最終ジャッジ日時 2023-09-25 05:51:45
合計ジャッジ時間 7,283 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
56,156 KB
testcase_01 AC 123 ms
55,708 KB
testcase_02 AC 124 ms
55,788 KB
testcase_03 AC 121 ms
55,792 KB
testcase_04 AC 123 ms
55,972 KB
testcase_05 AC 122 ms
55,460 KB
testcase_06 AC 123 ms
55,768 KB
testcase_07 AC 122 ms
56,016 KB
testcase_08 AC 120 ms
55,468 KB
testcase_09 AC 122 ms
55,732 KB
testcase_10 AC 120 ms
55,456 KB
testcase_11 AC 120 ms
55,776 KB
testcase_12 AC 118 ms
55,616 KB
testcase_13 AC 121 ms
56,144 KB
testcase_14 AC 120 ms
55,460 KB
testcase_15 AC 125 ms
55,396 KB
testcase_16 AC 121 ms
56,040 KB
testcase_17 AC 120 ms
55,676 KB
testcase_18 AC 122 ms
55,748 KB
testcase_19 AC 125 ms
55,400 KB
testcase_20 AC 121 ms
55,912 KB
testcase_21 AC 126 ms
55,864 KB
testcase_22 AC 120 ms
55,836 KB
testcase_23 AC 123 ms
55,804 KB
testcase_24 AC 122 ms
55,748 KB
testcase_25 AC 119 ms
55,744 KB
testcase_26 AC 120 ms
55,472 KB
testcase_27 AC 122 ms
55,904 KB
testcase_28 AC 126 ms
56,196 KB
testcase_29 AC 123 ms
56,072 KB
testcase_30 AC 122 ms
56,000 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt(),a[]=new int[11],t=0,i;
		sc.close();
		do {
			a[t]=n%7;
			t++;
			n/=7;
		}while(n>0) ;
		for(i=t;i>0;i--) System.out.print(a[i-1]);
	}
}
0