JC1001 Practical / Lab 4 – Iterative statements
原创2023/10/17大约 2 分钟...约 468 字
- Below you have the algorithm of a program that asks the user for a set of positive numbers and identifies the highest among them. The user enters the number 0 to finish the sequence. Implement the algorithm below and test it.
Set number with number entered by user
Set highest with number
while number is not 0
if number is greater than highest
Set highest with number
Set number with number entered by user
print highest
ZH
- 下面是一个程序的算法,该程序要求用户输入一组正数并确定其中的最大值。用户输入数字0以结束序列。实现下面的算法并测试它。
设置 number 为用户输入的数字
设置 highest 为 number
当 number 不为 0 时
如果 number 大于 highest
设置 highest 为 number
设置 number 为用户输入的数字
打印 highest
公众号:AI悦创【二维码】

AI悦创·编程一对一
AI悦创·推出辅导班啦,包括「Python 语言辅导班、C++ 辅导班、java 辅导班、算法/数据结构辅导班、少儿编程、pygame 游戏开发、Web、Linux」,全部都是一对一教学:一对一辅导 + 一对一答疑 + 布置作业 + 项目实践等。当然,还有线下线上摄影课程、Photoshop、Premiere 一对一教学、QQ、微信在线,随时响应!微信:Jiabcdefh
C++ 信息奥赛题解,长期更新!长期招收一对一中小学信息奥赛集训,莆田、厦门地区有机会线下上门,其他地区线上。微信:Jiabcdefh
方法一:QQ
方法二:微信:Jiabcdefh

更新日志
2025/4/11 07:49
查看所有更新日志
1c35a
-于aed17
-于4257f
-于62a3f
-于01745
-于27023
-于a1f1e
-于cbb3a
-于610fe
-于f08aa
-于76989
-于86c50
-于027da
-于