Вопрос задан 30.11.2023 в 23:40. Предмет Информатика. Спрашивает Майорова Лера.

Ввести значения трех сторон треугольника a, b, c и определить является ли он прямоугольным. Ответ

вывести в виде сообщения. На Java
0 0
Перейти к ответам

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

Внимание! Ответы на вопросы дают живые люди. Они могут содержать ошибочную информацию, заблуждения, а также ответы могут быть сгенерированы нейросетями. Будьте внимательны. Если вы уверены, что ответ неверный, нажмите кнопку "Пожаловаться" под ответом.
Отвечает Саменов Дархан.

Ответ:

print('Прямоугольный' if float(input('введите a:'))**2+float(input('введите b:'))**2 ==float(input('введите c:'))**2 else 'Не прямоугольный')

Объяснение:

По теореме Пифагора проверь

!!!!!ЕСЛИ ЧТО Я НЕ РОБО. МОГУ ОШИБИТСЯ!!!!

можно лучший для ранга?

0 0
Отвечает нейросеть ChatGpt. Будьте внимательны, ответы нейросети могут содержать ошибочные или выдуманные данные.

Calculating the Triangle's Type in Java

To determine if a triangle with sides a, b, and c is a right-angled triangle, we can use the Pythagorean theorem, which states that in a right-angled triangle, the square of the length of the hypotenuse (the side opposite the right angle) is equal to the sum of the squares of the lengths of the other two sides.

Here's a Java code snippet to calculate if the triangle is right-angled:

```java public class TriangleTypeChecker { public static void main(String[] args) { double a = 3; // Replace with the actual value of side a double b = 4; // Replace with the actual value of side b double c = 5; // Replace with the actual value of side c

if (a * a + b * b == c * c || a * a + c * c == b * b || b * b + c * c == a * a) { System.out.println("The triangle is a right-angled triangle."); } else { System.out.println("The triangle is not a right-angled triangle."); } } } ```

Replace the values of a, b, and c with the actual side lengths of the triangle. When you run this code, it will determine if the triangle with sides a, b, and c is a right-angled triangle.

Note: The code provided assumes that the sides a, b, and c are known and can be directly substituted into the code. If the sides are not known beforehand, additional user input or a different approach may be necessary to obtain the side lengths before performing the calculation.

Let me know if you need further assistance with this Java code!

0 0

Похожие вопросы

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

Последние заданные вопросы в категории Информатика

Задать вопрос