View Code of Problem 119

#include<stdio.h>
#include<math.h>
int main(){
	long i,n;
	int flag,k=1;
	while(scanf("%ld",&n)!=EOF){
		flag=0;
		for(i=2;i<=sqrt(n);i++){
			if(n%i==0){
				flag=1;
			    break;	
			}		
		}
		if(flag==1)
			printf("Case #%d: What a fxcking day\n",k++);
		else 
			printf("Case #%d: I'm richer than any one\n",k++);
	}
}

Double click to view unformatted code.


Back to problem 119