View Code of Problem 119

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