I want to cout the list starting from the person who ate most pancakes and finishing with the person who ate least.
but it doesn't work :P
#include <iostream>
int main ()
{
using namespace std;
int x;
int pancakes[10];
for (x=0;x<10;x++)
{
cin >> pancakes[x];
}
int order[10];
int i,j,m;
for (i=0; i<10; i++)
{
m=-5;
for (j=0+i;j<10;j++)
{
if (pancakes[j]>m)
{
m=pancakes[j];
}
order[i]=m;
}
int p;
for (p=0;p<10;p++)
{
cout << "Person number" << (p+1) << "ate :" << order[p] << "pancaakes" << endl;
}
}
return 0;
}