Pancake Exercise Tip

Hi, please can you help me on this code?
How can i output in decrescent or crescent order?
WARNING! PLEASE DON'T DO THE EXERCISE JUST GIVE ME TIPS.
Thanks,
Sky
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
using namespace std;
int main ()
{
	int a, Most=0, PersonPancakes[10+1];
	for (a=1;a<11;a++)
	{
		cout << "Person " << a << ": ";
		cin >> PersonPancakes[a];
		if (PersonPancakes[a]>Most)			//Take the value of PersonPancakes if are bigger than Most
		{
			PersonPancakes[a]=Most;			//Most save the Number
			Most = a;
		}
	}
	getchar();
	cout << "Who ate most pancakes was Person Number: " << Most;
	getchar();
	return 0;
}
Last edited on
Topic archived. No new replies allowed.