摘要:
刷水题判断有多少个素数。关键点避免超时。http://acm.hdu.edu.cn/showproblem.php?pid=2138View Code #include <stdio.h>#include <math.h>int isPrimer(unsigned int n ){ int i ; unsigned int m = sqrt(n); for(i = 2; i <= m; ++i) { if(!(n % i )) break; } return i > m;}int main(){ int n,m; ... 阅读全文