|
|
вернуться в форумWhy I added just one sentence then got "Output limit Exceeded"!What's that??!! Look the sentence with "!!!": program p1048new; var last,last2,n,p,q,s,i,j,k:longint;a:string; begin readln(n);last2:=-1;j:=0; for i:=1 to n do begin readln(p,q);last:=p+q; if (last<9)and(last2<>-1) then begin if s=0 then begin write(last2);last2:=last;end; if s<>0 then begin write(last2); !!!!!!!! for j:=1 to s do write('9');!!!!!!!! s:=0;last2:=last;end;end; if last=9 then inc(s); if (last>9)and(last2<>-1) then begin if s=0 then begin write(last2+1);last2:=last mod 10;end; if s<>0 then begin if last2=9 then dec(s); write(last2+1); for j:=1 to s do write('0'); s:=0;last2:=last mod 10; end; end; if last2=-1 then last2:=last; end; last:=last mod 10; if s=0 then write(last); if s<>0 then for i:=1 to s do write('9'); readln; end. |
|
|