結果

問題 No.192 合成数
ユーザー rf141
提出日時 2015-06-19 05:00:00
言語 Java
(openjdk 23)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 4,006 ms
コンパイル使用メモリ 74,680 KB
実行使用メモリ 41,684 KB
最終ジャッジ日時 2024-06-27 01:39:57
合計ジャッジ時間 7,889 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;
public class Num{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		int r;
		int result=0;
		int start = n-100,end = n+100;

		for(int i = start;i<=end;i++){
			for(int j = 2; j<i; j++){
				if(i%j==0){
					result=i;
					break;
				}
			}
			if(result != 0)break;
		}
		

		System.out.println(result);
	}
}
0