Advertisement
kallyy7

Untitled

Feb 28th, 2018
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.40 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 _03.Triangle
  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 < (a + b) && b < (a + c) && c < (a + b))
  18.             {
  19.                 if (a != b && b != c && c != a)
  20.                 {
  21.                     Console.WriteLine("Triangle with sides {0}, {1} and {2} is scalene.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  22.                 }
  23.                 else if (a == b && b != c)
  24.                 {
  25.                     Console.WriteLine("Triangle with sides {0}, {1} and {2} is isosceles.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  26.                 }
  27.                 else if (a == b && b == c)
  28.                 {
  29.                     Console.WriteLine("Triangle with sides {0}, {1} and {2} is equilateral.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  30.                 }
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine("There is no triangle with sides {0}, {1} and {2}.", a.ToString("0.###"), b.ToString("0.###"), c.ToString("0.###"));
  35.             }
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement