Advertisement
TheaThea

Untitled

Dec 6th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 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 Sums3Numbers
  8. {
  9. class Sums3Numbers
  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.  
  17. if (a + b == c)
  18. {
  19. if (a <= b)
  20. {
  21. Console.WriteLine($"{a} + {b} = {c}");
  22. }
  23. else
  24. {
  25. Console.WriteLine($"{b} + {a} = {c}");
  26. }
  27. }
  28.  
  29. else if (a + c == b)
  30. {
  31. if (a <= c)
  32. {
  33. Console.WriteLine($"{a} + {c} = {b}");
  34. }
  35.  
  36. else
  37. {
  38. Console.WriteLine($"{c} + {a} = {b}");
  39. }
  40. }
  41. else if (b + c == a)
  42. {
  43. Console.WriteLine($"{b} + {c} = {a}");
  44. }
  45. else
  46. {
  47. Console.WriteLine("No");
  48. }
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement