View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119