Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
一个PASCAL的代码,不用排序var s,j:string; a,b:array [0..100] of byte; c,d:array ['A'..'Z'] of integer; bb:boolean; p:char; i,t,k,n:integer; begin readln(s); readln(j); if length(s)<>length(j) then begin writeln('NO');exit; end; k:=length(s); for i:=1 to k do inc(c[s[i]]); for i:=1 to k do inc(d[j[i]]); for i:=1 to 26 do inc(a[c[chr(ord('A')-1+i)]]); for i:=1 to 26 do inc(b[d[chr(ord('A')-1+i)]]); bb:=true; for i:=1 to 100 do if a[i]<>b[i] then bb:=false; if bb then writeln('YES') else writeln('NO'); end. Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator