我的 m 文件:
function pay = salary
h = input('Please enter the number of hours worked : ');
w = input ('Please enter the hourly wage : $ ');
pay = h*w;
%this will add 50%of the hourly wage if it exceeds 40 hours
if h>40
pay = pay+((h-40)*0.5*w);
end
fprintf('The worker''s pay is $ %5.2f ', pay)
输出:
薪水
请输入工作小时数:2
请输入时薪:$2
工人的工资是 4.00 美元
答案=
4
我想删除 ans = 4 .. 我该怎么做?谁能帮帮我?