View Code of Problem 119

#include<bits/stdc++.h>
using namespace std;
int su(int n) {
	if (n == 1) {
		return 0;
	} else {
		for (int i = 2; i <= sqrt(n); i++)
			if (n % i == 0)
				return 0;
		return 1;
	}
}
int main() {
	int num=1;
	int n;
	while(cin>>n){
		if(su(n)||n==1){
			printf("Case #%d: I'm richer than any one\n",num);
		}
		else
			printf("Case #%d: What a fxcking day\n",num);
		num++;
	}
}

Double click to view unformatted code.


Back to problem 119