Advertisement
fbinnzhivko

Untitled

Jan 8th, 2017
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.50 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. namespace ConsoleApplication1
  4. {
  5.     class Program
  6.     {
  7.         static void Main()
  8.         {
  9.             decimal[] input = Console.ReadLine()
  10.                 .Split(new Char[] {' '}, StringSplitOptions.RemoveEmptyEntries)
  11.                 .Select(item => decimal.Parse(item))
  12.                 .ToArray();
  13.          
  14.             if (input[0] + input[1] + input[2] == 13)
  15.             {
  16.                 Console.WriteLine("Yes");
  17.             }
  18.             else if (input[0] - input[1] + input[2] == 13)
  19.             {
  20.                 Console.WriteLine("Yes");
  21.             }
  22.             else if (input[0] - input[1] - input[2] == 13)
  23.             {
  24.                 Console.WriteLine("Yes");
  25.             }
  26.             else if (input[0] + input[1] - input[2] == 13)
  27.             {
  28.                 Console.WriteLine("Yes");
  29.             }
  30.             else if (-input[0] + input[1] - input[2] == 13)
  31.             {
  32.                 Console.WriteLine("Yes");
  33.             }
  34.             else if (-input[0] - input[1] - input[2] == 13)
  35.             {
  36.                 Console.WriteLine("Yes");
  37.             }
  38.             else if (-input[0] - input[1] + input[2] == 13)
  39.             {
  40.                 Console.WriteLine("Yes");
  41.             }
  42.             else if (-input[0] + input[1] + input[2] == 13)
  43.             {
  44.                 Console.WriteLine("Yes");
  45.             }
  46.             else
  47.             {
  48.                 Console.WriteLine("No");
  49.             }
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement