View Code of Problem 119

#include<stdio.h>
#include <string.h>
#include <math.h>
int test(int n)
{
	int i,flag=1;
	for(i=2;i<n/2;i++)
	{
		if(n%i==0)
		{
			flag=0;
			break;
		}
	}
	return flag;
}
void main()
{
	int n,flag=1;
	while(scanf("%d",&n)!=EOF)
	{
		if(test(n))
		{
			printf("Case #%d: I'm richer than any one\n",flag++);

		}
		else
		{
          printf("Case #%d: What a fxcking day\n",flag++);
		}
		
	}
    
}

Double click to view unformatted code.


Back to problem 119