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 |
3077 1AC PASCALvar n,i,j,l:integer; a:string; a1:array[1..257]of integer; begin readln(n); for i:=1 to n do begin fillchar(a1,sizeof(a1),0); readln(a); l:=length(a); for j:=1 to l do a1[j]:=ord(a[l-j+1])-48; for j:=1 to l-1 do if a1[j]>=5 then begin inc(a1[j+1]); a1[j]:=0; end else a1[j]:=0; if a1[l+1]>0 then inc(l); for j:=l downto 1 do write(a1[j]); writeln; end; end. 顶起PASCAL!!! Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator