#include <iostream>
using namespace std;
int main() {
int greatestToLeastPancakeAmount[10] = {};
int greatestToLeastPersonNumber[10] = {};
int pancakeAmount;
int x;
cout << "Pancake Glutton 1.0 \n\n"; //State program's title
cout << "10 Different people ate pancakes for breakfast.. \n\n";
x = 0;
for(x=0;x<10;x++) {
cout << "How many pancakes did person " << (x + 1) << " eat? > ";
cin >> pancakeAmount;
greatestToLeastPersonNumber[x] = (x + 1);
greatestToLeastPancakeAmount[x] = pancakeAmount;
/*while(pancakeAmount > greatestToLeastPancakeAmount[(x - 1)]) {
int storeGreatestToLeastPancakeAmount = greatestToLeastPancakeAmount[(x-1)];
int storeGreatestToLeastPersonNumber = greatestToLeastPersonNumber[(x-1)];
greatestToLeastPancakeAmount[(x-1)] = pancakeAmount;
greatestToLeastPersonNumber[(x-1)] = x;
greatestToLeastPancakeAmount[x] = storeGreatestToLeastPancakeAmount;
greatestToLeastPersonNumber[x] = storeGreatestToLeastPersonNumber;
}*/
}
cout << "\n\n";
for(x=0;x<10;x++) {
cout << "Person " << greatestToLeastPersonNumber[x] << " ate " << greatestToLeastPancakeAmount[x] << " pancakes!\n";
}
return 0;
}
我如何完成输出吃煎饼最多的人数和吃最少煎饼的人数?