當前位置:編程學習大全網 - 編程軟體 - 會計算機的人幫我做壹下這幾道簡單的編程實驗題,我要寫實驗報告,但是不會做,幫幫忙了

會計算機的人幫我做壹下這幾道簡單的編程實驗題,我要寫實驗報告,但是不會做,幫幫忙了

如果是VF的話 就看下面

第壹個題;

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

希望對妳有用

經過實際操作檢驗過了

  • 上一篇:宿遷學院的文憑是二本還是三本
  • 下一篇:20多歲零基礎學編程是不是已經晚了?
  • copyright 2024編程學習大全網