View Code of Problem 119

#include<iostream>
#include<cmath>
#include<algorithm>
using namespace std;
bool isprime(long long int a)
{
    int i;
    if( i==1) return true;
    for( i=2;i<=sqrt(a);i++ )
    if( a%i == 0)return false;
    return true;
}
int main()
{
    int N,i=1;
    while( cin>>N )
    {
        if( isprime(N) )
        {
            cout<<"Case #"<<i++<<": "<<"I'm richer than any one"<<endl;

        }else cout<<"Case #"<<i++<<": "<<"What a fxcking day"<<endl;
    }
}

Double click to view unformatted code.


Back to problem 119