#include < iostream>
using namespace std;
int main(){ int n; cin > > n; float** a; a = (float**) malloc(n * sizeof(float*)); for(int i = 0; i < n; i++) a[i] = (float*)malloc(n * sizeof(float)); for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) cin > > a[i][j]; int i1; int max = a[0][0]; for(int i = 0; i < n; i++) { for(int j = 0; j < n; j++) { if(a[i][j]> max) { max = a[i][j]; i1 = i; } } } int sum = 0; for(int i = 0; i< n; i++) sum+=a[i1][i]; cout< < sum< < endl; system("pause"); return 0; }
var a: array [1..100,1..100] of real; i,j,maxi,n: integer; s,max: real; begin read(n); for i : = 1 to n do for j : = 1 to n do begin read(a[i,j]); if ((i=1) and (j=1)) or (max< a[i,j]) then begin max: =a[i,j]; maxi: =i; end; end; for j : = 1 to n do s: =s+a[maxi,j]; writeln(s); end.
Поделитесь своими знаниями, ответьте на вопрос:
program perimetr;
var
d : integer;
begin
writeln('dlina storon: ');
read(d);
d : = 3 * d;
writeln('otvet',d);
end;