|
|
back to boardWHY do i always receive OUTPUT LIMIT EXCEEded ??? HELP ME PLEASE THE ALGORITM IS RIGHT COULD YOU CHECK ONLY THE OUTPUT ??? :) i'm sure it's correct but i always receive output l e ..... is it correct to print the part of the answer while reading ??? var i,j,n,ile,x,y,suma,iled:longint; begin readln(n); repeat inc(i); read(x,y); if x+y<9 then if i>1 then begin write(suma);suma:=x+y;end else suma:=x+y else if x+y=9 then begin iled:=1; while x+y=9 do begin read(x,y); if x+y=9 then inc(iled); end; if x+y<9 then begin write(suma); for j:=1 to iled do write(9);
suma:=(x+y); end; if x+y>9 then begin write(suma+1); for j:=1 to iled do write(0);
suma:=(x+y)mod 10; end; n:=n-iled; end else begin write(suma+1); suma:=(x+y)mod 10; end; until i=n; write(suma); end. |
|
|