求大家帮做3道简单的数据库的计算题吧
发布网友
发布时间:2023-10-08 00:56
我来回答
共1个回答
热心网友
时间:2024-07-31 16:15
2.
CLEAR
INPUT "M=" TO M
INPUT "N=" TO N
? fact(m)/fact(n)
FUNCTION FACT
PARAMETERS N
FACT=1
FOR i=1 to n
fact=fact*i
ENDFOR
RETURN fact
3.
CLEAR
ACCEPT TO CHAR1 &&输入CHAR1的值
STORE 0 TO K1,K2,K3,K4
N=LEN(char1)
FOR i=1 TO N
C1=SUBSTR(char1,i,1)
DO CASE
CASE (ASC(C1)>=65 AND ASC(C1)<=90) OR (ASC(C1)>=97 AND ASC(C1)<=122)
K1=K1+1
CASE C1=SPACE(1)
K2=K2+1
CASE C1<="9" AND C1>="0"
K3=K3+1
CASE (ASC(C1)>=123 AND ASC(C1)<=255) OR (ASC(C1)>=91 AND ASC(C1)<=96) OR (ASC(C1)>=58 AND ASC(C1)<=64)
K4=K4+1
ENDCASE
NEXT
?"字母数:",K1
?"空格数:",K2
?"数字数:",K3
?"其他字符数:",K4