2 firyuza
[more]
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
var a: array[1..10] of real;
b: array[1..20] of real;
c: array[1..20,1..10] of real;
i,j:integer;
begin
{ TODO -oUser -cConsole Main : Insert code here }
for i:=1 to 20 do
begin
writeln ('input b[',i,']');
readln (b[i]);
end;
for i:=1 to 10 do
begin
writeln ('input a[',i,']');
readln (a[i]);
end;
for i:=1 to 10 do
begin
for j:=1 to 20 do
begin
c[i,j]:=a[j]/(1+abs(b[i]));
write(c[i,j]:3:5);
end;
writeln;
end;
end.
И если я правильно поняла условия 2й задачи, то 2:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var i,j:integer;
sum,max:real;
a:array[1..9,1..9] of real;
begin
for i:=1 to 9 do
for j:=1 to 9 do
begin
writeln('Input a[',i,',',j,']');
readln(a[i,j]);
end;
max:=0;
sum:=0;
for i:=1 to 9 do
begin
for j:=1 to (i-1) do
begin
if a[i,j]>max then max:=a[i,j];
end;
end;
for j:=1 to 9 do
begin
for i:=1 to j do
begin
if a[i,j]>max then sum:=sum+a[i,j];
end;
end;
if (sum=0) then writeln('No such elements!')
else writeln('summa= ',sum);
readln;
end.
[/more]
[more]
program Project2;
{$APPTYPE CONSOLE}
uses
SysUtils;
var a: array[1..10] of real;
b: array[1..20] of real;
c: array[1..20,1..10] of real;
i,j:integer;
begin
{ TODO -oUser -cConsole Main : Insert code here }
for i:=1 to 20 do
begin
writeln ('input b[',i,']');
readln (b[i]);
end;
for i:=1 to 10 do
begin
writeln ('input a[',i,']');
readln (a[i]);
end;
for i:=1 to 10 do
begin
for j:=1 to 20 do
begin
c[i,j]:=a[j]/(1+abs(b[i]));
write(c[i,j]:3:5);
end;
writeln;
end;
end.
И если я правильно поняла условия 2й задачи, то 2:
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils;
var i,j:integer;
sum,max:real;
a:array[1..9,1..9] of real;
begin
for i:=1 to 9 do
for j:=1 to 9 do
begin
writeln('Input a[',i,',',j,']');
readln(a[i,j]);
end;
max:=0;
sum:=0;
for i:=1 to 9 do
begin
for j:=1 to (i-1) do
begin
if a[i,j]>max then max:=a[i,j];
end;
end;
for j:=1 to 9 do
begin
for i:=1 to j do
begin
if a[i,j]>max then sum:=sum+a[i,j];
end;
end;
if (sum=0) then writeln('No such elements!')
else writeln('summa= ',sum);
readln;
end.
[/more]