判断素数模板

	public static boolean check(int num) {
		for(int i = 2; i <=Math.sqrt(num); i++) {
			if(num % i == 0)
				return false;
		}
		return true;
	}
posted @ 2020-03-07 17:19  Whisperbb  阅读(94)  评论(0编辑  收藏  举报