View Code of Problem 119

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

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

	return 0;
}

Double click to view unformatted code.


Back to problem 119