求高手做几道程序题,只要写出结果就可以了.

问题描述:

求高手做几道程序题,只要写出结果就可以了.
1、程序代码:
SET TALK OFF
CLEAR
A=’ABCDEFGH’
N=LEN(A)
FOR I=1 TO N SETP 2
SUBSTR(A,N-I-1,2)
ENDFOR
SET TALK ON
2、设N值为4,字符”A”的ASCII码为65.
程序代码:
SET TALK OFF
CLEAR
INPUT "N=" TO N
FOR I=1 TO N
SPACE(NI+1)
FOR J=1 TO 2*I1
CHR(ASC("A")+J1)
ENDFOR
ENDFOR
FOR P=N-1 TO 1 STEP 1
SPACE(N-P+1)
FOR K=1 TO 2*P1
CHR(ASC("A")+K1)
ENDFOR
ENDFOR
SET TALK ON
3、设N,M的值分别为6,8.
程序代码:
SET TALK OFF
CLEAR
INPUT "N=" TO N
INPUT "M=" TO M
X=MIN(N,M)
FOR I=X TO 1 STEP -1
IF M/I=INT(M/I) AND N/I=INT(N/I)
Y1=I
EXIT
ENDIF
ENDFOR
"Y1="+ALLTRIM(STR(Y1,19))+",Y2="+ALLTRIM(STR(M*N/Y1,19))
SET TALK ON
4、设输入的数值N为5
SET TALK OFF
CLEAR
INPUT “N=” TO N
DIME A(N,N)
P=N
DO WHILE N>0
A(N,N)=1
A(N,1)=1
N=N-1
ENDDO
FOR I=3 TO P
FOR J=2 TO I-1
A(I,J)=A(I-1,J-1)+A(I-1,J)
ENDFOR
ENDFOR
FOR I=1 TO P
SPACE(3*(P-I+1)
FOR J=1 TO I
STR(A(I,J),3)
ENDFOR
ENDFOR
SET TALK ON
5、SET TALK OFF
A=”ABCDEFGHIJKLMNOPQRSTUVWXYZ”
B=LEN(A)
X=”X_”
Y=”Y_”
I=1
DO WHILE I

所有的中文引号改为西文单引号1,SET TALK OFFCLEARA='ABCDEFGH'N=LEN(A)FOR I=1 TO N SETP 2SUBSTR(A,N-I-1,2)ENDFORSET TALK ONFGEFDECDBCAB2,SET TALK OFFCLEARINPUT "N=" TO NFOR I=1 TO NSPACE(N+I+1)FOR J=1 TO...