View Code of Problem 119

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


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

		
	}
	
	
	
	
	return 0;
}

Double click to view unformatted code.


Back to problem 119