View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119