View Code of Problem 119

#include<stdio.h>
void main()
{
	int a,count=0;
	while(scanf("%d",&a)!=EOF)
	{
		int flag=1;//用来标记是否为素数
		count++;
		for(int i=1;i<=a/2;i++)
		{
			if((a%i==0)&&(i!=1)){
				printf("Case #%d: What a fxcking day\n",count);
				flag=0;
				break;
			}	
		}
		if(flag==1)
			printf("Case #%d: I'm richer than any one\n",count);
	}
}

Double click to view unformatted code.


Back to problem 119