WA#3, please helpPPPPPPPPPP!!!!
Послано 
Bobur 10 фев 2008 20:21
here is my code!!!
   var
   a : array [0..9] of char=('0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
   i, n, j, k, x, y, last : integer;
 
begin
   read(n);
   read(x, y);  i := 1;  last := x+y;
   if n=1 then write(last)
   else   begin
   repeat
   read(x, y);   inc(i);
   if x+y<>9 then begin write(a[last + (x+y)div 10]);  last := (x+y) mod 10;  end
   else
     begin
       j := 1;
       repeat
       read(x, y);   inc(i);  inc(j);
       until (x+y<>9) or (j=10) or (i>=n);
       if x+y<9 then
         begin
           write(a[last]);
           for k := 1 to j-1 do
           write(a[9]);
           last := x + y;
         end;
       if x+y>9 then
         begin
           write(a[last+1]);
           for k := 1 to j-1 do
           write(a[0]);
           last := x + y-10;
         end;
       if x+y=9 then
         begin
           write(a[last+1]);
           for k := 1 to j-1 do
           write(a[0]);
           last := -1;
         end;
     end;
   until i=n;
   write(a[last]);   end;
end.
 
what i must do, i can't ubderstand where is my wrong!!!
thaks
 
Edited by author 10.02.2008 20:22
 
Edited by author 10.02.2008 20:23