编译失败, 返回值为 1, 编译器输出如下
foo.c: In function 'isprime':
foo.c:25: error: expected expression before 'int'
代码:
int isprime(int x){
int tmp;
if (x==2) return 1;
if (x==0) return 0;
else {
tmp=int(sqrt(x));
for (i=2;i<=tmp;i++){
if ((x%i)==0) return 0;
else return 1;
}
}
}