Advertisement
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;
- class Program
- {
- static void Main(string[] args)
- {
- string a = Console.ReadLine();
- string[] sace = a.Split(' ');
- int[] array = new int[sace.Length];
- for (int i = 0; i < sace.Length; i++)
- {
- array[i] = int.Parse(sace[i]);
- }
- int h = array.Sum() - array.Max();
- if (h == array.Max())
- {
- Console.WriteLine("Yes, sum={0}", h);
- }
- else
- {
- Console.Write("No, diff={0}", Math.Abs(h - array.Max()));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement