百度有提示
pascal写的大家可以参考
用 for
var
s:ansistring;
i,j,k,p:longint;
begin
readln(s);
for i:=1 to length(s)-1 do
case s[i] of
'A'..'Z': write(ord(s[i])-64);
end;
end.
用 while
var
ch:char;
begin
read(ch);
while ch<>'.' do
begin
case ch of
'A'..'Z': write(ord(ch)-64);
' ': write('*');
end;
read(ch);
end;
end.