* 1 *任意输入N个数,统计其中正数、负数、和零的个数
dimension a(3)
a=0
input "个数:" to N
for i=1 to N
input "请输入第"+alltrim(str(i))+"个数:" to a1
b1=SIGN(a1)+2
a(b1)=a(b1)+1
endfor
? "正数的个数:",a(3)
? "零的个数:",a(2)
? "负数的个数:",a(1)
* 2 * 任意输入N个数,找出其中的最大数和最小数,以及求出其平均数
input "个数:" to N
if n=0
return
endif
input "请输入第1个数:" to a1
max=a1
min=a1
s=a1
for i=2 to N
input "请输入第"+alltrim(str(i))+"个数:" to a1
if a1>max
max=a1
else
if a1
endif
endif
s=s+a1
endfor
? "最大数:",max
? "最小数:",min
? "平均值:",s/n
fushu=0
zhengshu=0
ling=0
input "请问要输入多少个数:" to m
dimension a(m)
for i=1 to m
input "请输入第"+alltrim(str(i))+"个数:" to a(i)
endfor
for j=1 to m
do case
case a(j)=0
ling=ling+1
case a(j)>0
zhengshu=zhengshu+1
case a(j)<0
fushu=fushu+1
endcase
endfor
?"0",ling
?"+",zhengshu
?"-",fushu
2.
CLEAR
nmax=0
nmin=0
input "请问要输入多少个数:" to m
dimension a(m),b(m)
for i=1 to m
input "请输入第"+alltrim(str(i))+"个数:" to a(i)
b(i)=a(i)
endfor
for j=1 to m-1
if a(j)>a(j+1)
nmax=a(j)
a(j)=a(j+1)
a(j+1)=nmax
ENDIF
IF b(j)nmin=b(j)
b(j)=b(j+1)
b(j+1)=nmin
endif
endfor
?"max:",nmax
?"min:",nmin