Advertisement
Sim0o0na

Untitled

Jan 30th, 2017
673
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.98 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 DayOfWeekArr
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             long[] arr = Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
  14.             var counter = 0;
  15.  
  16.             for (int i = 0; i < arr.Length; i++)
  17.             {
  18.                 for (int b = i+1; b < arr.Length; b++)
  19.                 {
  20.                     for (int c = 0; c < arr.Length; c++)
  21.                     {
  22.                         if (arr[i] + arr[b] == arr[c])
  23.                         {
  24.                             Console.WriteLine(arr[i] + " + " + arr[b] + " == " + arr[c]);
  25.                             counter++;
  26.                         }
  27.                     }                  
  28.                 }
  29.             }
  30.             if (counter == 0)
  31.             {
  32.                 Console.WriteLine("No");
  33.             }
  34.         }
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement