!!!!!!!!!!!!!ДАЮ 50 БАЛЛОВ!!!!!!!!!!!!!!!! Переведите программу с Pascal на Python:

var a:array[1..40000,1..2] of byte;
f:text;
n,i,j,k:integer;
begin
assign(f,'input.txt');
reset(f);
read(f,n);
for i:=1 to n do
read(f,a[i,1],a[i,2]);
close(f);
k:=0;
for i:=1 to n-1 do
for j:=i+1 to n do
if(a[i,1]=a[j,1])or(a[i,1]=a[j,2])
or(a[i,2]=a[j,1])or(a[i,2]=a[j,2])then inc(k);
assign(f,'output.txt');
rewrite(f);
write(f,k);
close(f);
end.
Please enter comments
Please enter your name.
Please enter the correct email address.
You must agree before submitting.

Copyright © 2024 SCHOLAR.TIPS - All rights reserved.