Requires:
variables, data types, and numerical operators
basic input/output
logic (if statements, switch statements)
loops (for, while, do-while)
arrays
Write a program that asks the user to enter the number of pancakes eaten for breakfast by 10 different people (Person 1, Person 2, ..., Person 10)
Once the data has been entered the program must analyze the data and output which person ate the most pancakes for breakfast.
★ Modify the program so that it also outputs which person ate the least number of pancakes for breakfast.
★★★★ Modify the program so that it outputs a list in order of number of pancakes eaten of all 10 people.
i.e.
Person 4: ate 10 pancakes
Person 3: ate 7 pancakes
Person 8: ate 4 pancakes
...
Person 5: ate 0 pancakes
该程序用C++编写,旨在让使用者输入10个人早餐吃的煎饼数量,并找出吃最多和最少煎饼的人。通过使用类`Person`存储ID和煎饼数量,程序首先收集数据,然后比较并输出吃最多和最少煎饼的人。最后,程序将所有人按吃的煎饼数量从多到少排序并输出。
煎饼哥&spm=1001.2101.3001.5002&articleId=6259765&d=1&t=3&u=79f6ebb89c1541359717e486032a7bf7)
249

被折叠的 条评论
为什么被折叠?



