Java90分 #7#11超时
查看原帖
Java90分 #7#11超时
1115315
rz3790楼主2023/12/13 16:10
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int q = (int)Math.ceil(Math.sqrt(n))-1;
		int f = 1;
		while(f!=0) {
			q++;
			f = n%q;
		}
		System.out.println(q);
	}
}
2023/12/13 16:10
加载中...