
Untitled
By: a guest on
May 6th, 2012 | syntax:
None | size: 0.71 KB | hits: 11 | expires: Never
# include <iostream>
# include <conio.h>
# include <time.h>
using namespace std;
void randComp(int *comp)
{
*comp = rand()%10;
}
void comparing(int hum,int comp,int count)
{
if(hum == comp)
{
count++;
}
else
count--;
}
bool endGame(int count)
{
if (count != 0)
true;
else
return 0;
}
int main()
{
int count ;
int hum;
int comp;
srand (time(NULL));
cout << "put your money"<<"\n";
cin >> count;
for ( ; ; )
{
cout << "put the nuber"<<"\n";
cin >> hum;
randComp(&comp);
cout << "comp"<< '-' << comp<<"\n";
comparing(hum,comp,count);
cout << "count is"<< ' - ' << count<<"\n";
endGame(count);
}
getch ();
return 0;
}