View Code of Problem 119

#include<iostream>
#include<cstring>
#include<math.h>
using namespace std;
int main(){
	int n,count=0;
	while(scanf("%d",&n)!=EOF)
	{	
		int flag=0;
		count++;
		for(int i=2;i<=sqrt(n);i++)
			if(n%i==0)
			{
				flag=1;
				break;
			}
		if(flag==0)
			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