結果

問題 No.746 7の倍数
ユーザー Beat7501Beat7501
提出日時 2019-01-14 10:13:32
言語 Java
(openjdk 23)
結果
AC  
実行時間 540 ms / 2,000 ms
コード長 410 bytes
コンパイル時間 2,433 ms
コンパイル使用メモリ 75,956 KB
実行使用メモリ 65,532 KB
最終ジャッジ日時 2025-01-02 22:26:53
合計ジャッジ時間 12,718 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(n == 0){
			System.out.println(0);
		}else{
			int num[] = {1,4,2,8,5,7};
			System.out.print("0.");
			int idx = 0;
			for(int i = 1; i <= n; i++){
				System.out.print(num[idx]);
				idx++;
				if(idx == 6){
					idx = 0;
				}
			}
			System.out.println();
		}
	}
}
0