【求助】一个PASCAL拚数程序,看不懂帮我!!
'8''5'转换成85
(练习CASE语句)
PROGRAM convert (input,output);
VAR
ch:char;
result,scale:real;
BEGIN
result:=0;
read(ch);
write(ch);
REPEAT
result:=result*10+ord(ch)-ord('0');
read(ch);
write(ch)
UNTIL (ch<'0') OR (ch>'9');
IF ch='.'
THEN BEGIN
scale:=1;
read(ch);
write(ch);
REPEAT
result:=result*10+ord(ch)-ord('0');
scale:=scale*10;
read(ch);
write(ch);
UNTIL (ch<'0') OR (ch>'9');
result:=result/scale;
END; {IF}
writeln('=',result);
END. }