找到最低分 [英] Finding the lowest score

查看:70
本文介绍了找到最低分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,这是我的程序:

First of all, here is my program:

展开 | 选择 | Wrap | 行号

推荐答案

您的else-if链只检查数字是否小于LO,或1000,并且它们只执行一次,没有循环,所以它只执行第一个(100),但不循环LO重置后返回。 (如果在if-else语句中使用了分支,则忽略其余部分)你应该把它放在一个循环中,你将不得不改变你的逻辑 - 否则它会在每次循环时打印出来执行。
Your else-if chain only checks to see if the numbers are less than LO, or 1000, and they only do it once, there''s no looping, so it only does the first one (100), but doesn''t loop back after LO is reset. (If a branch is taken in an if-else statement, the rest of it is disregarded) You should put that in a loop, and you''ll have to change your logic a bit - otherwise it will print out each time the loop is executed.



你的else-if链只检查数字是否小于LO或1000,他们只做它曾经没有循环,所以它只执行第一个(100),但在LO复位后不会循环回来。 (如果在if-else语句中使用了分支,则忽略其余部分)你应该把它放在一个循环中,你将不得不改变你的逻辑 - 否则它会在每次循环时打印出来被执行。
Your else-if chain only checks to see if the numbers are less than LO, or 1000, and they only do it once, there''s no looping, so it only does the first one (100), but doesn''t loop back after LO is reset. (If a branch is taken in an if-else statement, the rest of it is disregarded) You should put that in a loop, and you''ll have to change your logic a bit - otherwise it will print out each time the loop is executed.



你能在我的程序中告诉我哪里去了吗?


Can you please show me in my program where that goes???



我尝试使用if语句,但所有数字都打印为低数字
I tried it with if statements, but all of the numbers printed out as low numbers



你试过一次while循环吗?重复几次,然后只有当你确定它已经检查了所有其他4个最低值时才退出?

Have you tried a while loop? Having it repeat several times, and then exiting only when you''re sure it has checked all 4 other values against your lowest?


这篇关于找到最低分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆