View Code of Problem 119

#include<bits/stdc++.h>
using namespace std;

int iszs(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0) {
			return 0;
		}
	}
	return 1;
}
int main() {
	long long n;
	int k = 0;
	while (cin >> n) {
		if (iszs(n)) {
			cout << "Case #" << ++k << ": I'm richer than any one" << endl;
		}
		else {
			cout << "Case #" << ++k << ": What a fxcking day" << endl;
		}
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 119