9.Зад Triangle Formations Data types and variables
Имам 80т.Мисля,че греша в else, но не зная точно какво.Моля малко помощ!https://judge.softuni.bg/Contests/Submissions/View/2660102
using System;
namespace Ttiangle__Formations
{
class Program
{
static void Main(string[] args)
{
double a = double.Parse(Console.ReadLine());
double b = double.Parse(Console.ReadLine());
double c = double.Parse(Console.ReadLine());
if (a * a + b * b == c * c)
{
Console.WriteLine("Triangle is valid.");
Console.WriteLine("Triangle has a right angle between sides a and b");
}
else if (b * b + c * c == a * a)
{
Console.WriteLine("Triangle is valid.");
Console.WriteLine("Triangle has a right angle between sides b and c");
}
else if (c * c + a * a == b * b)
{
Console.WriteLine("Triangle is valid.");
Console.WriteLine("Triangle has a right angle between sides a and c");
}
else if ((a + b > c) || (a + c > b) || ( b + c > a))
{
Console.WriteLine("Triangle is valid.");
Console.WriteLine("Triangle has no right angles");
}
else
{
Console.WriteLine("Invalid Triangle.");
}
}
}
}
Благодаря много!