|
|
back to boardWhy WA #10 ? Pascal Posted by Denuha 1 Mar 2014 16:56 var mas: array [1..100] of integer; mas2: array [1..100, 1..100] of integer; n, k, str, f, i, j, kol: integer; begin readln(n, k); {for i:=1 to n do read mas[i];} {Считаем кол-во строк} if n mod k <> 0 then str := (n div k) + 1 else str := n div k; {Считаем "полную" матрицу} kol := k * str; for i := 1 to n do read(mas[i]); {Заполняем "-1" будущие пустые места} for i := n + 1 to kol do mas[i] := -1; f := 1; for i := 1 to k do for j := 1 to str do begin mas2[j, i] := mas[f]; inc(f); end; for i := 1 to str do begin for j := 1 to k do if mas2[i, j] <> -1 then write(mas2[i, j]:4) else continue; writeln; end; end. |
|
|