View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119