第壹個題;
set talk off
clear
input "請輸入重量: " to x
if x>100
s=(x-100)*0.02+5
else
s=x*0.02
endif
"郵費是: "+str(s,5,2)set talk on
close all
return
第2個題:
set talk off
clear
s=0
for n=1 to 10
a=1
for m=1 to n
a=a*m
endfor
s=s+a
endfor
set talk on
close all
return
第2個題還可以給妳延伸下 就是求到 x的階乘和
set talk off
clear
input "請輸入截止到什麽數的階乘和: " to x
s=0
for n=1 to x
a=1
for m=1 to n
a=a*m
endfor
s=s+a
endfor
set talk on
close all
return
希望對妳有用
經過實際操作檢驗過了