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 |
哼!NOI前都不让我过!把程序放在这儿,明天到了郑州再干掉它!In Reply To:为什么RE??? Posted by:JiangLY at 2005-08-04 22:20:32 var t,s:array[1..3000] of longint; a,b,i,k,n:longint; begin readln(n); a:=0; b:=0; for i:=1 to n do begin read(s[i]); if s[i]=0 then inc(a) else inc(b); end; readln; k:=0; i:=1; if a<>0 then begin repeat while s[i]<>0 do inc(i); inc(i); inc(k); t[k]:=i; until k=a; end; i:=1; if b<>0 then begin repeat while s[i]<>1 do inc(i); inc(i); inc(k); t[k]:=i; until k=n; end; for i:=1 to n do write(s[t[i]],' '); writeln; end. Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator