#include<stdio.h> #include<math.h> bool isprime(int n) { if(n<=1) return false; int sqr=(int)sqrt(n*1.0); for(int i=2;i<=sqr;i++) { if(n%i==0) return false; } return true; } int main() { int k=1,n; while(scanf("%d",&n)!=EOF) { if(isprime(n)||n==1) printf("Case #%d: I'm richer than any one\n",k++); else printf("Case #%d: What a fxcking day\n",k++); } return 0; } /* Main.c:3:1: error: unknown type name 'bool' bool isprime(int n) ^ Main.c: In function 'isprime': Main.c:6:9: error: 'false' undeclared (first use in this function) return false; ^ Main.c:6:9: note: each undeclared identifier is reported only once for each function it appears in Main.c:13:9: error: 'true' undeclared (first use in this function) return true; ^ Main.c:14:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ */ |
Double click to view unformatted code.