View Code of Problem 119

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

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

Double click to view unformatted code.


Back to problem 119