Skip to content

Instantly share code, notes, and snippets.

@waterlink
Created June 6, 2011 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save waterlink/1010612 to your computer and use it in GitHub Desktop.
Save waterlink/1010612 to your computer and use it in GitHub Desktop.
задача А
{есть алгоритм:}
const
N = 20;
var
n, i, j: integer;
a: array[1..N][1..N] of integer;
s: longint;
begin
writeln('enter size of matrix 1 <= n <= ', N, ':');
readln(n);
for i:= 1 to n do
for j:= 1 to n do begin
writeln('enter a[', i, '][', j, ']');
readln(a[i][j]);
end;
s:= 0;
for i:= 1 to n do
for j:= 1 to n do
s:= s + a[i][j];
writeln('matrix sum is ', s);
end.
{Требуется при помощи рекурсии избавиться от циклов.}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment