我正在创建一个伪代码,用于确定用户输入的正数列表中的最大数字



我正在创建一个伪代码,用于确定用户输入的正数列表中的最大数字。AL因此,用户应该通过输入0来指示他/她已经完成了数字输入。感谢

max <-- 0     // assigning max to 0      
n <-- read()  // read user input
while n!=0 
{
  if(n>max)     // check if n is greater than max
     max <-- n  // if true update max
  n <-- read()  // read next input
}
print(max)     // print max

最新更新