Created
June 6, 2011 16:44
-
-
Save waterlink/1010612 to your computer and use it in GitHub Desktop.
задача А
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{есть алгоритм:} | |
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