View Code of Problem 119

#include <iostream>
#include <cmath>
using namespace std;
int main(){
	int n,j=1;
	while(cin>>n){
		int k=1;
		for(int i=2;i<=sqrt(n);i++){
			if(n%i==0){
				k=i;
				break;
			}
		}
		if(k==1)
			cout<<"Case #"<<j<<": I'm richer than any one"<<endl;
		else
			cout<<"Case #"<<j<<": What a fxcking day"<<endl;
		j++;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 119