View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119