Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] nums = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
- bool notEql = true;
- for (int i = 0; i < nums.Length; i++)
- {
- for (int j = i+1; j < nums.Length; j++)
- {
- if (nums.Contains(nums[i] + nums[j]))
- {
- Console.WriteLine($"{nums[i]} + {nums[j]} == {nums[i] + nums[j]}");
- notEql = false;
- }
- }
- }
- if (notEql)
- {
- Console.WriteLine("No");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment