Program t1; Var a: array[1..n,1..m] of integer; i,n,m,max,s: integer; Begin Read (n,m); S:=0; Max:=0; For i:=1 to n do Begin S:=s+a[i]; End; For i:=1 to m do Begin If (max>a[i]) then Max:=max Else max:=a[i]; End; Write (s); Write (max); End.
Var s: string; a, b: integer; begin readln(s); if s[1] = 'x' then begin a := StrToInt(s[3]); b := StrToInt(s[5]); if s[2] = '-' then a := -a; writeln(b - a); end else if s[3] = 'x' then begin a := StrToInt(s[1]); b := StrToInt(s[5]); if s[2] = '-' then begin a := -a; b := -b; end; writeln(b - a); end else if s[5] = 'x' then begin a := StrToInt(s[1]); b := StrToInt(s[3]); if s[2] = '-' then b := -b; writeln(a + b); end end.
учтите что никакой защиты от дурака или неверного ввода
const n = 100;
m = 100;
var A: array[1..n,1..m] of integer;
max,i,j,s: integer;
begin
randomize;
for i := 1 to n do begin
s := 0;
for j := 1 to m do begin
s := s + A[i,j];
end;
write('Summa elementov stroki ', i);
writeln(' ravna ', s);
end;
max := 1;
for i := 1 to m do begin
if (A[2,i] > A[2,max]) then max := i;
end;
writeln('Max element 2 stroki raven', A[max]);
end.