Advertisement
VZhelev

C# Sum to 13

May 27th, 2017
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 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. using System.Globalization;
  7.  
  8. namespace SoftUni
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string[] input = Console.ReadLine().Split();
  15.             int a = int.Parse(input[0]);
  16.             int b = int.Parse(input[1]);
  17.             int c = int.Parse(input[2]);
  18.             bool check = true;
  19.  
  20.             if ((a + b + c) == 13)
  21.             {
  22.                 Console.WriteLine("Yes");
  23.                 check = false;
  24.             }
  25.  
  26.             if ((a + b + (c * -1)) == 13)
  27.             {
  28.                 Console.WriteLine("Yes");
  29.                 check = false;
  30.             }
  31.  
  32.             if ((a + (b * -1) + c) == 13)
  33.             {
  34.                 Console.WriteLine("Yes");
  35.                 check = false;
  36.             }
  37.  
  38.             if ((a + (b * -1) + (c * -1)) == 13)
  39.             {
  40.                 Console.WriteLine("Yes");
  41.                 check = false;
  42.             }
  43.  
  44.             if (((a * -1) + b + c) == 13)
  45.             {
  46.                 Console.WriteLine("Yes");
  47.                 check = false;
  48.             }
  49.  
  50.             if (((a * -1) + b + (c * -1)) == 13)
  51.             {
  52.                 Console.WriteLine("Yes");
  53.                 check = false;
  54.             }
  55.  
  56.             if (((a * -1) + (b * -1) + c) == 13)
  57.             {
  58.                 Console.WriteLine("Yes");
  59.                 check = false;
  60.             }
  61.  
  62.             if (((a * -1) + (b * -1) + (c * -1)) == 13)
  63.             {
  64.                 Console.WriteLine("Yes");
  65.                 check = false;
  66.             }
  67.            
  68.             if (check)
  69.             {
  70.                 Console.WriteLine("No");
  71.             }
  72.         }
  73.     }
  74. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement