View Code of Problem 119

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int isPrime(int n){
	if(n==1) return 1;
	for(int i = 2;i*i <= n;i++){
		if(n%i==0) return 0;
	}
	return 1;
}
int main (){
	int n, k = 0;
	while(~scanf("%d", &n)){
		if(isPrime(n)) printf("Case #%d: I'm richer than any one\n", ++k);
		else printf("Case #%d: What a fxcking day\n", ++k);
	}

	return 0;
}

Double click to view unformatted code.


Back to problem 119