View Code of Problem 119

#include<stdio.h>
#include<math.h>
int sushu(int b){
	int i;
	for (i=2;i<sqrt(b);i++)
		if(b%i==0)
			return 0;
		return 1;
}
int main(){
	long int a,k=0;

    while(scanf("%ld",&a)!=EOF)
	{
		k++;
		if (sushu(a)==0)
			printf("Case #%ld: What a fxcking day\n",k);
		else if(sushu(a)==1)
			printf("Case #%ld: I'm richer than any one\n",k);
	}
  return 0;	
}

Double click to view unformatted code.


Back to problem 119