摘要:
#include <iostream> using namespace std; #define MAXN 1000000 int n, B, A, M[MAXN], C[MAXN], l, r, ans, mid; bool check(int nn) { int count = 0, i, j; 阅读全文
摘要:
在判断一个数字是否为质数时,如果数字N是固定的,则最好事先算出它的平方根,并且放入一个变量中,这样是最简单方便的。 这样循环的次数就固定了。 #include<bits/stdc++.h> using namespace std; int main() { int n,j; cin>>n; j=0; 阅读全文