NEED HELP!!!!

Can you help me write a C++ Program which allow the user to input a number of rows for the tower of numbers.

sample dialog:

enter a number:

tower of numbers 1
2 3 2
3 4 5 4 3
4 5 6 7 6 5 4
5 6 7 8 9 8 7 6 5


thanks....
Last edited on
1
2
3
4
5
6
7
8
9
10
for(int r = 1 ; r <=5; r++)
	{
		int v = r;
		cout << r;
		for(int c = 0; c < r-1; c++)
			cout << (++v);
		for(int c = 0; c < r-1; c++)
			cout << (--v);
		cout << endl;
	}
Topic archived. No new replies allowed.