【发布时间】:2014-11-09 20:03:30
【问题描述】:
正在开发一个假设循环并显示 13 次的程序。这是我的代码
{
var count;
var user_Input;
var output_msg;
var cel;
count = 0;
do
{
user_Input = get_integer("Temperature conversion","");
count = count + 1;
cel = user_Input * 9/5 +32;
user_Input = user_Input +10;
output_msg =(string(count) + "Celsius" + string(user_Input) + " = Farenheit " + string(cel));
show_message(output_msg);
}
until (count == 13)
}
它的作用是每次我按 Enter 时显示循环,而不是一次显示所有 13 个,如果我输入 10,例如每次循环它假设从最后一个循环添加 10。
例如。 1. 摄氏 10 = 华氏(在此处回答)
..... 2. 摄氏 20 = 华氏 (在此回答)
......13. Celsuis 130 = Farenheit ""
如果有人能带我走过并帮助我,那就太好了
【问题讨论】:
-
将
user_Input = get_integer(...);行移到循环外