Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

1AC的PASCAL代码

Posted by demaxiya at 2012-08-21 15:55:54 on Problem 2141
var
s:string;
cc:char;
aa:array ['a'..'z'] of char;
ab:array ['A'..'Z'] of char;
a,i,j,k:integer;
begin
for i:=1 to 26 do begin
read(cc);
aa[chr(97+i-1)]:=cc;
ab[chr(65+i-1)]:=chr(ord(cc)-32);
end;
readln;readln(s);
for i:=1 to length(s) do
if (s[i]<='Z') and (s[i]>='A') then s[i]:=ab[s[i]]
 else if (s[i]<='z') and (s[i]>='a') then s[i]:=aa[s[i]];
 writeln(s);
end.

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator