結果

問題 No.499 7進数変換
ユーザー kazapyon27kazapyon27
提出日時 2017-05-28 10:27:20
言語 Java21
(openjdk 21)
結果
AC  
実行時間 54 ms / 1,000 ms
コード長 606 bytes
コンパイル時間 3,357 ms
コンパイル使用メモリ 74,956 KB
実行使用メモリ 53,456 KB
最終ジャッジ日時 2023-10-21 13:52:57
合計ジャッジ時間 5,973 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
53,440 KB
testcase_01 AC 53 ms
53,440 KB
testcase_02 AC 54 ms
53,436 KB
testcase_03 AC 53 ms
52,356 KB
testcase_04 AC 54 ms
53,436 KB
testcase_05 AC 54 ms
53,440 KB
testcase_06 AC 53 ms
53,432 KB
testcase_07 AC 53 ms
53,456 KB
testcase_08 AC 53 ms
53,444 KB
testcase_09 AC 53 ms
53,432 KB
testcase_10 AC 53 ms
53,436 KB
testcase_11 AC 53 ms
53,448 KB
testcase_12 AC 53 ms
53,440 KB
testcase_13 AC 53 ms
53,440 KB
testcase_14 AC 52 ms
51,496 KB
testcase_15 AC 53 ms
53,440 KB
testcase_16 AC 53 ms
53,448 KB
testcase_17 AC 54 ms
53,432 KB
testcase_18 AC 53 ms
53,448 KB
testcase_19 AC 53 ms
53,448 KB
testcase_20 AC 53 ms
53,452 KB
testcase_21 AC 54 ms
53,432 KB
testcase_22 AC 53 ms
53,428 KB
testcase_23 AC 53 ms
53,436 KB
testcase_24 AC 53 ms
53,448 KB
testcase_25 AC 54 ms
53,448 KB
testcase_26 AC 53 ms
53,436 KB
testcase_27 AC 53 ms
53,440 KB
testcase_28 AC 53 ms
53,440 KB
testcase_29 AC 53 ms
53,436 KB
testcase_30 AC 53 ms
53,432 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)){
				n++;
			}
			while(n>=0){
				s_number=s_number.concat(Integer.toString(TransNumber/(int)Math.pow(7, n)));
				TransNumber%=(int)Math.pow(7, n);
				n--;
			}
			System.out.println(Long.parseLong(s_number));
		}catch(Exception e){
			e.printStackTrace();
		}
	}
}
0