Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- namespace MagicSum
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int num = int.Parse(Console.ReadLine());
- for (int i = 0; i < arr.Length; i++)
- {
- int furstNum = arr[i];
- for (int j = i + 1; j < arr.Length; j++)
- {
- int secondNum = arr[j];
- if (furstNum + secondNum == num)
- {
- Console.WriteLine($"{furstNum} {secondNum}");
- break;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement