Advertisement
koksibg

Sums_3_Numbers

Jul 12th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.00 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 Sums_3_Numbers
  8. {
  9.     class Sums_3_Numbers
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var a = int.Parse(Console.ReadLine());
  14.             var b = int.Parse(Console.ReadLine());
  15.             var c = int.Parse(Console.ReadLine());
  16.             if ((a + b == c) && (a <= b)) Console.WriteLine("{0} + {1} = {2}", a, b, c);
  17.             else if ((b + a == c) && (b <= a)) Console.WriteLine("{0} + {1} = {2}", b, a, c);
  18.             else if ((a + c == b) && (a <= c)) Console.WriteLine("{0} + {1} = {2}", a, c, b);
  19.             else if ((c + a == b) && (c <= a)) Console.WriteLine("{0} + {1} = {2}", c, a, b);
  20.             else if ((b + c == a) && (b <= c)) Console.WriteLine("{0} + {1} = {2}", b, c, a);
  21.             else if ((c + b == a) && (c <= b)) Console.WriteLine("{0} + {1} = {2}", c, b, a);
  22.             else Console.WriteLine("No");
  23.         }
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement