
даны стороны трехугольника a, b, c напишите программу определяющую является ли треугольник
равносторонним, разносторонним, равнобедренным. python 

Ответы на вопрос

Ответ:
a = int(input('1 сторона треугольника: '))
b = int(input('2 сторона треугольника: '))
c = int(input('3 сторона треугольника: '))
if a == b == c:
print('Треугольник равносторонний')
elif a == b or b == c or a == c:
print('Треугольник равнобедренный')
else:
print('Треугольник разносторонний')



Program to Determine Triangle Type in Python
To determine whether a triangle is equilateral, scalene, or isosceles, you can use the following Python program:
```python def triangle_type(a, b, c): if a == b == c: return "Equilateral" elif a != b != c != a: return "Scalene" else: return "Isosceles"
# Example usage side1 = 5 side2 = 5 side3 = 5 print(triangle_type(side1, side2, side3)) # Output: Equilateral ```
This program defines a function `triangle_type` that takes three side lengths as input and returns the type of the triangle based on the side lengths. It checks if all sides are equal to determine if the triangle is equilateral, if no sides are equal to determine if the triangle is scalene, and if two sides are equal to determine if the triangle is isosceles.
You can replace the example usage with your own values for `side1`, `side2`, and `side3` to test different triangles.


Похожие вопросы
Топ вопросов за вчера в категории Информатика







Последние заданные вопросы в категории Информатика
-
Математика
-
Литература
-
Алгебра
-
Русский язык
-
Геометрия
-
Английский язык
-
Химия
-
Физика
-
Биология
-
Другие предметы
-
История
-
Обществознание
-
Окружающий мир
-
География
-
Українська мова
-
Информатика
-
Українська література
-
Қазақ тiлi
-
Экономика
-
Музыка
-
Право
-
Беларуская мова
-
Французский язык
-
Немецкий язык
-
МХК
-
ОБЖ
-
Психология
-
Физкультура и спорт
-
Астрономия
-
Кыргыз тили
-
Оʻzbek tili