Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- class Program
- {
- static void Main()
- {
- int.Parse("5.5");
- List<double> sequence = Console.ReadLine().Split(new char[] {' '}, StringSplitOptions.RemoveEmptyEntries).Select(double.Parse).ToList();
- if (sequence.Count == 0)
- {
- Console.WriteLine("Yes, sum=0");
- return;
- }
- double max = sequence.Max();
- sequence.Remove(max);
- if (sequence.Sum() == max)
- {
- Console.WriteLine("Yes, sum=" + max);
- }
- else
- {
- double diff = Math.Abs(max - sequence.Sum());
- Console.WriteLine("No, diff=" + diff);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement