判断素数的函数写错了,供参考:
int isPrime(int n) { int i; if (n <= 3) return n > 1; for (i = 2; i * i <= n; i++) if (n % i == 0) return 0; return 1; }