View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119