Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const
- Xcap = 8;
- Ycap = 8;
- type
- data = array[1..Xcap, 1..Ycap] of integer;
- var
- A: data;
- function max_column(d: data): integer;
- var
- sum, i, j, col, top: integer;
- begin
- for i := 1 to Xcap do
- begin
- sum := 0;
- for j := 1 to Ycap do
- begin
- sum := sum + A[i, j];
- end;
- if (sum > top) then
- begin
- top := sum;
- col := i;
- end;
- end;
- max_column := col;
- end;
- begin
- var i, j: integer;
- for i := 1 to Xcap do
- begin
- for j := 1 to Ycap do
- readln(A[i, j]);
- end;
- writeln(max_column(A));
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement