s=0 t=1
for i=1 to 4 t=t*i endfor s=s+t t=1
for i=1 to 7 t=t*i endfor s=s+t t=1
for i=1 to 3 t=t*i endfor s=s*t ?s return
3.1!+3!+5!+....+99!= clear s=1 t=1
for i=3 to 99 step 2 t=t*i*(i-1) s=s+t endfor
?' 1!+3!+5!+....+99!=',s return 4.3!+5!+7! s=0 t=1
for i=3 to 7 step 2 t=t*i*(i-1) s=s+t endfor
?\return
5.3!+8!+11!的和 clear s=0 t=1
for i=1 to 3 t=t*i endfor s=s+t t=1
for i=1 to 8 t=t*i endfor s=s+t t=1
for i=1 to 11 t=t*i endfor s=s+t ?s return
6.10~100之间不能被3整除的数的和 clear s=0
for m=10 to 100 if mod(m,3)!=0 ?m s=s+m ?s endif endfor return
7.10~100之间能被3整除的数 clear
for m=10 to 100 if mod(m,3)=0 ?m endif
endfor return
8.1000-1100素数和 clear m=0
for k=1000 to 1100 f=0 j=2
do while f=0 and j
m=m+k endif endfor ?m
9.编写分段函数程序 第一种方法: clear
input '请输入X数值:'to x if x>3
y=3*x-10 else
if x<-3
y=2*x+10 else y=x endif endif ?'y=',y return
第二种方法: clear
input\请输入一个数\
do case case x>3 y=3*x-10 case x<-3 y=2*x+10 otherwise y=x endcase return
10.计算1!+2!+3!+…+100! clear s=0 n=1
for i=1 to 100 n=n*i s=s+n endfor
?'1!+2!+3!+...+100!=',s return
11. 计算1+2+3+…+100 clear s=0
for i=1 to 100 s=s+i endfor
?'1+2+3+...+100=',s return
12. 输入10个数,找最大值和最小值 方法1. clear
input'请输入一个数:'to x store x to max,min for i=2 to 10
input'请输入一个数:'to x if max<=x max=x else
相关推荐: