View Code of Problem 119

#include<stdio.h>
#include<stdlib.h>
#include<math.h>

int main(){
	long num,count=0;
	while((scanf("%ld",&num)!=EOF)){
		count++;
		if(num==1 || num == 2){
			printf("Case #%d: I'm richer than any one\n",count);
		
		}else{
			int flag = 1;
			for(long i=2; i<=sqrt(num*1.0); i++){
				if(num%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);
			
			}
		
		}
	
	
	}


	return 0;
}

Double click to view unformatted code.


Back to problem 119