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
#include <iostream>
usingnamespace 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;
}