View Code of Problem 119

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

Double click to view unformatted code.


Back to problem 119