1232946
18.04.2020 18:06

преобразовать с Паскаля задачу на питон program Matrix36;
var
a:array [1..10,1..10] of integer;
Num, M, N, i, j:Integer;
Line1,LineM : set of byte;

begin
Write('N: ');
Readln(N);
Write('M: ');
Readln(M);

for i:=1 to M do
begin
writeln(i,': ');
for j:=1 to N do
begin
Write(j,' : ');
Read(a[i,j]);
end;
end;

Line1:=[];
for j:=1 to N do Line1:=Line1+[a[1,j]];

Num:=0;
for i:=2 to M do
begin
LineM:=[];

for j:=1 to N do LineM:=LineM+[a[i,j]];

if Line1=LineM then inc(Num);
end;
Writeln(Num);
end.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
Kazybek2005
20.05.2023 21:05

Объяснение:

1

program Middle;

var

  mid, x1,x2,x3 : integer;

begin

   write('input x1, x2, x3 ');

   readln(x1,x2,x3);

   if x1 < x2  

   then    if x1 < x3

           then    if x2 < x3

                   then mid := x2

                   else mid := x3

           else    mid := x1

   else    if x1 > x3

           then    if x2 < x3

                   then mid := x3

                   else mid := x2

           else    mid := x1;

   writeln ('Middle is ',mid);

end.

2

program pifagor;

var

   Cat1, Cat2, Hyp, Space : real;

begin

   write ('Cat1, Cat2 :');

   Readln (Cat1, Cat2);

   Hyp := sqrt (sqr(Cat1)+sqr(Cat2));

   Space := (Cat1 * Cat2)/2;

   WriteLn ('By Cat1 =',Cat1:5:2,' and Cat2 = ',Cat2:5:2,' Hyp is: ',Hyp:5:2, ' Space is: ',Space:5:2);

end.

0,0(0 оценок)
Ответ:
Ametov2007
25.01.2023 16:40

#include <iostream>

#include <fstream>

#include <random>

using namespace std;

int main()

{

   ofstream fout("f.txt");

random_device rd;  

   mt19937 mer(rd());

for(int i = 0 ; i < 10 ; ++i)

 fout << mer() << ' ';

fout.close();

 

ofstream gout("g.txt");

ifstream fin("f.txt");

for (int i = 0 ; i < 10 ; ++i)

{

 unsigned int temp;

 fin >> temp;

 if( temp % 2 == 0 )

  gout << temp << ' ';

 cout << temp << ' ';

 

}

fin.close();

gout.close();

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота