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;
Если что-то неправильно сделал, не суди, давно не программировал и уже особо не помню.
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;
Если что-то неправильно сделал, не суди, давно не программировал и уже особо не помню.