主题:念数字
游戏之王
[专家分:540] 发布于 2007-08-14 09:33:00
从键盘输入0--999中的任意一个整数,将其换成汉语拼音表示并打印输出。以X4为名存盘(20分)
例如: 输入:15 输入:238
输出:YI WU 输出:ER SAN BA
回复列表 (共5个回复)
沙发
网虫一号 [专家分:1230] 发布于 2007-08-14 09:38:00
CLS
DIM A$(9)
FOR I = 0 TO 9: N = 0
READ A$(I)
NEXT I
DATA Ling,Yi,Er,San,Si,Wu,Liu,Qi,Ba,Jiu
10 INPUT "X="; X: IF X < 0 OR X > 999 OR X <> X \ 1 THEN 10
WHILE X > 0
N = N + 1: A(N) = X MOD 10
X = X \ 10
WEND
FOR I = N TO 1 STEP -1
PRINT A$(A(I)); ; " ";
NEXT I
END
板凳
小精灵1号 [专家分:1040] 发布于 2007-08-14 09:39:00
CLS
DIM A$(9)
FOR I = 0 TO 9: N = 0
READ A$(I)
NEXT I
DATA Ling,Yi,Er,San,Si,Wu,Liu,Qi,Ba,Jiu
10 INPUT "X="; X: IF X < 0 OR X > 999 OR X <> X \ 1 THEN 10
WHILE X > 0
N = N + 1: A(N) = X MOD 10
X = X \ 10
WEND
FOR I = N TO 1 STEP -1
PRINT A$(A(I)); ; " ";
NEXT I
END
3 楼
我的电脑 [专家分:990] 发布于 2007-08-14 09:44:00
CLS
DIM A$(9)
FOR I = 0 TO 9: N = 0
READ A$(I)
NEXT I
DATA Ling,Yi,Er,San,Si,Wu,Liu,Qi,Ba,Jiu
10 INPUT "X="; X: IF X < 0 OR X > 999 OR X <> X \ 1 THEN 10
WHILE X > 0
N = N + 1: A(N) = X MOD 10
X = X \ 10
WEND
FOR I = N TO 1 STEP -1
PRINT A$(A(I)); ; " ";
NEXT I
END
4 楼
小小傻瓜 [专家分:150] 发布于 2007-08-14 15:01:00
CLS
DIM A$(9)
FOR I = 0 TO 9: N = 0
READ A$(I)
NEXT I
DATA Ling,Yi,Er,San,Si,Wu,Liu,Qi,Ba,Jiu
10 INPUT "X="; X: IF X < 0 OR X > 999 OR X <> X \ 1 THEN 10
WHILE X > 0
N = N + 1: A(N) = X MOD 10
X = X \ 10
WEND
FOR I = N TO 1 STEP -1
PRINT A$(A(I)); ; " ";
NEXT I
END
5 楼
hxy_anhui [专家分:320] 发布于 2009-01-29 21:55:00
CLS
FOR I = 0 TO 9
READ A$(I)
NEXT I
INPUT N
FOR I = 1 TO LEN(LTRIM$(STR$(N)))
PRINT A$(VAL(MID$(LTRIM$(STR$(N)), I, 1))); " ";
NEXT I
DATA LING, YI, ER, SAN, SI, WU, LIU, QI, BA, JIU
END
我来回复