import math as m
def Perimeter():
x1 = int(input("x1 = "))
y1 = int(input("y1 = "))
x2 = int(input("x2 = "))
y2 = int(input("y2 = "))
x3 = int(input("x3 = "))
y3 = int(input("y3 = "))
print("A({};{})\tB({};{})\tC({};{})".format(x1,y1,x2,y2,x3,y3))
""" √ ((X ₂-X ₁) ² + (Y ₂-Y ₁) ²) +
√ ((X ₃-X ₂) ² + (Y ₃ — Y ₂) ²) +
√ ((X ₃-X ₁) ² + (Y ₃-Y ₁) ²). """
p = m.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2) + m.sqrt((x3 - x2) ** 2 + (y3 - y2) ** 2) + m.sqrt(
(x3 - x1) ** 2 + (y3 - y1) ** 2)
print('Периметр: P = {}.'.format(p))
print('Полупериметр: p = {}.'.format(p/2))
Perimeter()
#include <iostream>
#include <Windows.h>
using namespace std;
int num;
while(true) {
cin >> num;
cout << num << " x 1 = " << num * 1 << endl;
cout << num << " x 2 = " << num * 2 << endl;
cout << num << " x 3 = " << num * 3 << endl;
cout << num << " x 4 = " << num * 4 << endl;
cout << num << " x 5 = " << num * 5 << endl;
cout << num << " x 6 = " << num * 6 << endl;
cout << num << " x 7 = " << num * 7 << endl;
cout << num << " x 8 = " << num * 8 << endl;
cout << num << " x 9 = " << num * 9 << endl;
}
system("pause");
return 0;
Если что-то неправильно сделал, не суди, давно не программировал и уже особо не помню.
var s: array of integer;
x,n,p,sum,max,min,i,k,o,m:integer;
begin
p:=1;
sum:=0;
m:=-1;
o:=-1;
max:=-MaxInt;
min:=MaxInt;
Write('n= ');
read(n);
setlength(s,n);
Writeln('Перечислите значения:');
for x:=0 to n-1 do begin
read (s[x]);
k:=s[x];
if (k>0) and ((k mod 5) =0) then sum:=sum+k;
if ((k mod 10)=0) and (k>max) then begin max:=k; o:=x; end;
if ((k mod 2) = 0) and (k<min) then begin min:=k; m:=x; end;
end;Writeln('Сумма = ',sum);
if (ABS(o-m)=1) or (o=m) or (o=-1) or (m=-1) then write('Диапазон не найден')
else begin
if (o>m) then
for i:=m+1 to o-1 do
p:=s[i]*p
else
for i:=o+1 to m-1 do
p:=s[i]*p;
writeln('Произведение = ',p);
end;
end.