結果

問題 No.499 7進数変換
ユーザー kazapyon27kazapyon27
提出日時 2017-05-28 10:05:48
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 594 bytes
コンパイル時間 3,690 ms
コンパイル使用メモリ 75,984 KB
実行使用メモリ 53,504 KB
最終ジャッジ日時 2023-10-21 13:52:50
合計ジャッジ時間 6,423 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 55 ms
52,364 KB
testcase_02 AC 53 ms
53,484 KB
testcase_03 AC 53 ms
53,496 KB
testcase_04 AC 51 ms
53,492 KB
testcase_05 AC 52 ms
53,496 KB
testcase_06 AC 51 ms
53,488 KB
testcase_07 AC 52 ms
53,492 KB
testcase_08 AC 53 ms
53,484 KB
testcase_09 AC 52 ms
53,492 KB
testcase_10 AC 52 ms
53,496 KB
testcase_11 AC 52 ms
52,384 KB
testcase_12 AC 53 ms
53,496 KB
testcase_13 AC 53 ms
52,416 KB
testcase_14 AC 53 ms
53,488 KB
testcase_15 AC 54 ms
53,500 KB
testcase_16 AC 51 ms
53,488 KB
testcase_17 AC 54 ms
53,492 KB
testcase_18 AC 53 ms
53,492 KB
testcase_19 AC 53 ms
53,496 KB
testcase_20 AC 53 ms
52,400 KB
testcase_21 AC 54 ms
53,496 KB
testcase_22 AC 52 ms
53,488 KB
testcase_23 AC 52 ms
53,500 KB
testcase_24 AC 51 ms
52,364 KB
testcase_25 AC 53 ms
53,492 KB
testcase_26 AC 53 ms
53,504 KB
testcase_27 AC 54 ms
53,492 KB
testcase_28 AC 53 ms
53,496 KB
testcase_29 AC 54 ms
52,396 KB
testcase_30 AC 53 ms
53,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.499 7進数変換*/
import java.io.*;
public class No499 {
	public static void main(String[] args) {
		int TransNumber,n=0;
		String s_number=new String();
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			TransNumber=Integer.parseInt(input.readLine());
			while(TransNumber>(int)Math.pow(7, n)-1){
				n++;
			}
			while(n>0){
				s_number=s_number.concat(Integer.toString(TransNumber/(int)Math.pow(7, n-1)));
				TransNumber%=(int)Math.pow(7, n-1);
				n--;
			}
			System.out.println(s_number);
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0