View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119