Program Project1; var a:array[1..5] of Integer; i, j, sum:Integer; s:string; begin Readln(s); sum:=0; for i:=1 to 5 do begin if (Length(s)>=2) then begin j:=Pos(' ', s); a[i]:=StrToInt(Copy(s, 1, j-1)); sum:=sum+a[i]; Delete(s, 1, j); end else begin a[i]:=StrToInt(s); sum:=sum+a[i]; end; end; for i:=1 to 5 do begin if (a[i]<>0) then begin a[i]:=a[i]-sum; Write(a[i], ' '); end else begin a[i]:=a[i]; Write(a[i], ' '); end; end; end.
Var a : array [1..3] of array [1..3] of integer; i,j : shortint; c1,c2,s1,s2 : integer;
begin a[1][1]:=-10; a[1][2]:=20; a[1][3]:=13; a[2][1]:=-22; a[2][2]:=11; a[2][3]:=-5; a[3][1]:=4; a[3][2]:=12; a[3][3]:=-8; s1:=0; s2:=0; c1:=0; c2:=0; for i:=1 to 3 do begin for j:=1 to 3 do begin if a[i][j]>0 then begin s1:=s1+a[i][j]; inc (c1); end else begin s2:=s2+a[i][j]; inc (c2); end; end; end; writeln (s1/c1:0:0); writeln (s2/c2:0:2); end.
var
a:array[1..5] of Integer;
i, j, sum:Integer;
s:string;
begin
Readln(s);
sum:=0;
for i:=1 to 5 do
begin
if (Length(s)>=2) then
begin
j:=Pos(' ', s);
a[i]:=StrToInt(Copy(s, 1, j-1));
sum:=sum+a[i];
Delete(s, 1, j);
end
else
begin
a[i]:=StrToInt(s);
sum:=sum+a[i];
end;
end;
for i:=1 to 5 do
begin
if (a[i]<>0) then
begin
a[i]:=a[i]-sum;
Write(a[i], ' ');
end
else
begin
a[i]:=a[i];
Write(a[i], ' ');
end;
end;
end.
i,j : shortint;
c1,c2,s1,s2 : integer;
begin
a[1][1]:=-10;
a[1][2]:=20;
a[1][3]:=13;
a[2][1]:=-22;
a[2][2]:=11;
a[2][3]:=-5;
a[3][1]:=4;
a[3][2]:=12;
a[3][3]:=-8;
s1:=0; s2:=0; c1:=0; c2:=0;
for i:=1 to 3 do begin
for j:=1 to 3 do begin
if a[i][j]>0 then begin
s1:=s1+a[i][j];
inc (c1);
end else begin
s2:=s2+a[i][j];
inc (c2);
end;
end;
end;
writeln (s1/c1:0:0);
writeln (s2/c2:0:2);
end.