在给出用户名称列表后,按字母顺序显示名字和姓氏

时间:2017-03-12 23:08:06

标签: pseudocode

设计一个程序,询问用户一系列名称(无特定顺序)。在输入最终人名后,程序应按字母顺序显示名称,并按字母顺序显示最后一个名称 例如,如果用户输入名字Kristin,Joel,Adam,zeb,Beth和Chris,程序将显示Adam和zeb。 我坚持在While声明,我怎么能让程序知道什么名称按字母顺序排列。有些人告诉我使用我无法使用的数组,我们尚未学会它。仅使用IF和While Statments。

1 个答案:

答案 0 :(得分:0)

好吧,在伪代码中,它看起来像这样:

// 1) Get names from user and store them in array
// 2) Order array alphabetically
// 3) Get first element in array and display it
// 4) Get last element in array and display it

这是你在找什么?