|
|
вернуться в форум28K only var cyc2,tm,s1,s2,s,n,k,cyc1:longint; begin read(n); read(s1,s2); tm:=s1+s2; k:=0; if tm=9 then inc(k); for cyc1:=1 to n-1 do begin read(s1,s2); s:=s1+s2; if k=0 then begin if s<9 then begin write(tm);tm:=s; end; if s=9 then inc(k); if s>9 then begin write(tm+1);tm:=s-10; end; end else begin if s<9 then begin write(tm);for cyc2:= 1 to k do write (9);tm:=s;k:=0; end; if s=9 then inc(k); if s>9 then begin write(tm+1);for cyc2:= 1 to k do write (0); tm:=s-10;k:=0; end; end; end; if k=0 then write(tm) else begin if tm<>9 then write(tm); for cyc2:= 1 to k do write (9);end; end. Re: 28K only Послано Effort 30 апр 2004 22:29 Why don't you try this? 4 9 0 9 0 9 0 1 9 I'm sure that your answer is wrong! But! You got AC! ft...... I have no idea about the test system! Re: 28K only In your example there will be 5 digits and n is only 4. I've got accepted too in the same ideea |
|
|