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;
- namespace ConsoleApp35
- {
- class Program
- {
- static void Main(string[] args)
- {
- double biggest = double.MinValue;
- double sum = 0;
- int round = int.Parse(Console.ReadLine());
- for (int i = 0; i<round; i++)
- {
- double number = double.Parse(Console.ReadLine());
- if (number >biggest )
- {
- biggest = number;
- }
- sum = sum + number;
- }
- if (biggest == (sum-biggest))
- {
- Console.WriteLine($"Yes");
- Console.WriteLine($"Sum = {Math.Abs(biggest)}");
- }
- else
- {
- Console.WriteLine($"No");
- Console.WriteLine($"Diff = {Math.Abs((sum-biggest)-biggest)}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement