#include
void pi(int df)
{
std::cout <<"\nwelcome hacker";
std::cout <<"\nU have to enter the correct combination for level="<<df;
}
bool p(int df)
{
pi(df);
int a=rand()%df+df;
int b=rand()%df+df;
int c=rand()%df+df;
int sum=a+b+c;
int prod=a*b*c;
std::cout <<"\t\nGUESS: sum of three number is=" <<sum;
std::cout <<"\t\t\nGUESS: product ot three number is="<<prod;
int G1, G2, G3;
std::cout<<"\n\tenter the number code to move forward\n";
std::cin>>G1;
std::cin>>G2;
std::cin>>G3;
std::cout<<"the numbers are\n"<<G1 <<std::endl <<G2 <<std::endl <<G3;
int GS=G1+G2+G3;
int GP=G1*G2*G3;
if ( sum==GS && prod==GP)
{
std::cout<<"\nU cracked the code weldone\n";
return true;
}
else
{
std::cout<<"\nU loose to crack the code u noob\n";
return false;
}
}
int main()
{
int d=1;
int const md=5;
while (d <= md)
{
bool bcompletelvl=p(d);
std::cin.ignore();
std::cin.clear();
if(d)
++d;
}
return 0;
}