#include <iostream>
#include <fstream>
using namespace std;
const int max_tries=7;
int earnings=0;
int wordnum;
void getword ()
{
ifstream fin;
string word;
//int mark;
int value;
cin >value;
fin.open("guess.txt");
if (!fin.good())
{
cerr << "File not found\n";
// return 1;
}
int i =0;
while(!fin.eof())
{
i++;
fin >word;
if(i==value)
break;
}
cout << word << endl;
//cout << "Mark is : " << mark << endl << endl;
//return 0;
}
int main()
{
cout << "*** HANGMAN Guess a Word Game *** \n";
int NUM;
cout << "Enter a number between 1 to 20: ";
cin >>NUM;
if (NUM<1)
cout << "Too small. Please enter a number between 1 to 20: ", cin >>
NUM;
if (NUM>20)
cout << "Too big. Please enter a number between 1 to 20: ", cin >>
NUM;
cout << "Current earnings: $" << earnings << "\n";
cout << "Max number of tries is " << max_tries << "\n";
getword ();
cout << "*********************************" << endl;
system ("pause");
return 0;
}