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

3077 1AC PASCAL

Posted by aiouniya at 2012-08-24 08:50:07 on Problem 3077
var 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:
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