結果

問題 No.192 合成数
ユーザー rf141rf141
提出日時 2015-06-19 05:00:00
言語 Java21
(openjdk 21)
結果
AC  
実行時間 127 ms / 2,000 ms
コード長 394 bytes
コンパイル時間 3,516 ms
コンパイル使用メモリ 71,896 KB
実行使用メモリ 56,260 KB
最終ジャッジ日時 2023-09-09 08:32:05
合計ジャッジ時間 8,110 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 124 ms
55,980 KB
testcase_01 AC 124 ms
55,776 KB
testcase_02 AC 122 ms
56,088 KB
testcase_03 AC 123 ms
56,000 KB
testcase_04 AC 127 ms
56,064 KB
testcase_05 AC 125 ms
55,756 KB
testcase_06 AC 125 ms
56,232 KB
testcase_07 AC 123 ms
55,444 KB
testcase_08 AC 121 ms
55,456 KB
testcase_09 AC 123 ms
55,940 KB
testcase_10 AC 124 ms
55,776 KB
testcase_11 AC 124 ms
55,832 KB
testcase_12 AC 122 ms
56,260 KB
testcase_13 AC 124 ms
55,892 KB
testcase_14 AC 124 ms
55,772 KB
testcase_15 AC 124 ms
55,764 KB
testcase_16 AC 124 ms
55,308 KB
testcase_17 AC 123 ms
56,104 KB
testcase_18 AC 123 ms
56,100 KB
testcase_19 AC 122 ms
56,076 KB
testcase_20 AC 125 ms
56,084 KB
testcase_21 AC 124 ms
56,104 KB
testcase_22 AC 125 ms
56,016 KB
testcase_23 AC 124 ms
55,876 KB
testcase_24 AC 123 ms
55,900 KB
testcase_25 AC 122 ms
55,740 KB
testcase_26 AC 122 ms
55,456 KB
権限があれば一括ダウンロードができます

ソースコード

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