pascal
Объяснение:
const n = 5; m = 5;
var a: array [1..n, 1..m] of integer;
procedure fillarray(k: integer);
var i, j: integer;
begin
randomize;
for i := 1 to n do
for j := 1 to m do a[i, j] := random(k);
end;
procedure transarray();
var i, j, k: integer;
for j := i+1 to m do
k := a[i, j];
a[i, j] := a[j, i];
a[j, i] := k;
procedure printarray();
for i:=1 to n do
for j:=1 to m do
write(a[i, j]:3);
writeln;
fillarray(10);
printarray();
transarray();
end.
import math
a = [float(input("Input x: ")), float(input("Input y: "))]
print(a)
x = a[0]
y = a[1]
y1 = x-1
if abs(x)<=1:
y2 = math.sqrt(1-x**2)
if x>=0 and y>=y1 and y<=1:
print("Yes")
elif x>=0 and x<=1 and y<y1 and abs(y)<=y2:
else:
print("No")
if abs(x)<=1 and abs(y)<=y2:
elif x>=0 and x<=1 and y>=0 and y<=1:
pascal
Объяснение:
const n = 5; m = 5;
var a: array [1..n, 1..m] of integer;
procedure fillarray(k: integer);
var i, j: integer;
begin
randomize;
for i := 1 to n do
for j := 1 to m do a[i, j] := random(k);
end;
procedure transarray();
var i, j, k: integer;
begin
for i := 1 to n do
for j := i+1 to m do
begin
k := a[i, j];
a[i, j] := a[j, i];
a[j, i] := k;
end;
end;
procedure printarray();
var i, j: integer;
begin
for i:=1 to n do
begin
for j:=1 to m do
write(a[i, j]:3);
writeln;
end;
writeln;
end;
begin
fillarray(10);
printarray();
transarray();
printarray();
end.
import math
a = [float(input("Input x: ")), float(input("Input y: "))]
print(a)
x = a[0]
y = a[1]
y1 = x-1
if abs(x)<=1:
y2 = math.sqrt(1-x**2)
if x>=0 and y>=y1 and y<=1:
print("Yes")
elif x>=0 and x<=1 and y<y1 and abs(y)<=y2:
print("Yes")
else:
print("No")
a = [float(input("Input x: ")), float(input("Input y: "))]
print(a)
x = a[0]
y = a[1]
if abs(x)<=1:
y2 = math.sqrt(1-x**2)
if abs(x)<=1 and abs(y)<=y2:
print("Yes")
elif x>=0 and x<=1 and y>=0 and y<=1:
print("Yes")
else:
print("No")
Объяснение: