如何用matlab写这个程序
C=5/9(F-32)要求输入一个F,出来相应的结果C。必须满足以下条件:1.让用户输入F,出来相应的C。2.必须反复接受输入F,出来C,直到用户要求停止。(K=inpu...
C=5/9(F-32) 要求输入一个F,出来相应的结果C。必须满足以下条件:
1.让用户输入F,出来相应的C。
2.必须反复接受输入F,出来C,直到用户要求停止。(K = input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’)) 展开
1.让用户输入F,出来相应的C。
2.必须反复接受输入F,出来C,直到用户要求停止。(K = input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’)) 展开
2个回答
展开全部
clc;clear;
F=input('请输入华氏温度(°C):');
C=5/9*(F-32);
str=sprintf('相应的摄氏温度为:%f°C',C);
disp(str);
reply=input('Do you want to continue the calculation? If yes, please enter Y\n','s');
while reply=='Y'
F=input('请输入华氏温度(°C):');
C=5/9*(F-32);
str=sprintf('相应的摄氏温度为:%f°C',C);
disp(str);
reply=input('Do you want to continue the calculation? If yes, please enter Y\n','s');
end
F=input('请输入华氏温度(°C):');
C=5/9*(F-32);
str=sprintf('相应的摄氏温度为:%f°C',C);
disp(str);
reply=input('Do you want to continue the calculation? If yes, please enter Y\n','s');
while reply=='Y'
F=input('请输入华氏温度(°C):');
C=5/9*(F-32);
str=sprintf('相应的摄氏温度为:%f°C',C);
disp(str);
reply=input('Do you want to continue the calculation? If yes, please enter Y\n','s');
end
展开全部
clear
K = input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’);
while K=='Y'
F=input('F=',f);
C=5/9*(F-32)
K=input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’);
end
K = input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’);
while K=='Y'
F=input('F=',f);
C=5/9*(F-32)
K=input(‘Do you want to continue the calculation? If yes, please enter Y\n’, ‘s’);
end
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询