Advertisement
kallyy7

Untitled

Feb 28th, 2018
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _00.ffg
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double a = double.Parse(Console.ReadLine());
  14.             double b = double.Parse(Console.ReadLine());
  15.             double c = double.Parse(Console.ReadLine());
  16.  
  17.             if (a < b + c && b < a + c && c < a + b)
  18.             {
  19.                 if (a == b && b == c && a == c)
  20.                 {
  21.                     Console.WriteLine($"Triangle with sides {a}, {b} and {c} is equilateral.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  22.                 }
  23.                 else if (a == b || b == c || c == a )
  24.                 {
  25.                     Console.WriteLine($"Triangle with sides {a}, {b} and {c} is isosceles.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  26.                 }
  27.                 else if (a != b && b != c && c!= a)
  28.                 {
  29.                     Console.WriteLine($"Triangle with sides {a}, {b} and {c} is scalene.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  30.                 }
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine($"There is no triangle with sides {a}, {b} and {c}.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement