|
|
back to boardWhy I got WA on test 3#?? Posted by akademi 30 Oct 2004 19:58 Program ural1048; Var i,j,t,n,c,a,b:longint; p:boolean; Begin readln(n); t:=0; p:=false; for i:=1 to n do begin readln(a,b); if a+b<9 then begin if p then write(c); for j:=1 to t do write(9); t:=0; c:=a+b; p:=true; end; if a+b=9 then inc(t); if a+b>9 then begin write(c+1); for j:=1 to t do write(0); t:=0; c:=(a+b) mod 10; p:=true end end; write(c); for i:=1 to t do write(9); writeln; End. Edited by author 30.10.2004 19:58 Re: A test for you (+) Posted by akademi 31 Oct 2004 05:54 Thank you. |
|
|