My game need to work

When i run my game the life mechanism is supposed to appear only once at each "round" but what it do is:
Enter a number other than 0: 7
Enter a number other than 1: 8
you have 9 lifes left
you have 8 lifes left
you have 7 lifes left
...
you have 1 lifes left
Enter a number other than 2: 6

Can someone fix it to be like:

Enter a number other than 0: 7
You have 9 lifes left
Enter a number other than 1: 4
you have 8 lifes left
...
Until the GAME OVER.
here is the code:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#include <iostream>
using namespace std;
int main ()
{
	int n, d, x;
	cout << "Enter a number other than 0: ";
	cin >> d;

	for (n=1;n!=0;n++)
	{
		if (d!=0)
		{
			cout << "Enter a number other than " << n << ": ";
			cin >> d;
			getchar ();
			if (n==d)
			{
				cout << "Other than " << n << "!";
				goto exit;
				getchar();
			}
		}
			for (x=9; x>0; x--)
			{
				cout << "You have " << x << " lives left\n"; 
				if (x==0)
				{
					cout << "GAME OVER";
					getchar ();
					goto exit;
				}
			}
	}
	exit:
	getchar ();
	return 0;
}
Topic archived. No new replies allowed.