Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Ievadi trijstura pirmo malu: ");
- int a = int.Parse(Console.ReadLine());
- Console.Write("Ievadi trijstura otru malu: ");
- int b = int.Parse(Console.ReadLine());
- Console.Write("Ievadi trijstura treso malu: ");
- int c = int.Parse(Console.ReadLine());
- int max, min, d, e, srd = 0;
- if (a+b<=c && a+c<=b && b+c<=a)
- {
- Console.WriteLine("Tāds trijsturis neeksiste!");
- }
- else
- {
- Console.WriteLine("Tāds trijsturis eksiste!");
- if (a > b && a > c)
- {
- max = a;
- }
- else if (b > a && b > c)
- {
- max = b;
- }
- else if (c > a && c > b)
- {
- max = c;
- }
- if (a < b && a < c)
- {
- min = a;
- }
- else if (b < a && b < c)
- {
- min = b;
- }
- else if (c < a && c < b)
- {
- min = c;
- }
- srd = a + b + c - max - min;
- d = min * min + srd * srd;
- e = max * max;
- Console.WriteLine("Trijsturis ir taisnlenka!");
- }
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement