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 ConsoleApp39
- {
- class Program
- {
- static void Main(string[] args)
- {
- double sum = double.MinValue;
- var n = new[] { $"{sum}" };
- double biggestNum = double.MinValue;
- Console.Write("Enter the number of numbers: ");
- int numbers = int.Parse(Console.ReadLine());
- Console.WriteLine("Enter the numbers.");
- for (var i = 0; i < numbers; i++)
- {
- int num = int.Parse(Console.ReadLine());
- sum += num;
- if (num > biggestNum)
- {
- biggestNum = num;
- }
- }
- if (biggestNum == sum)
- {
- Console.WriteLine("They are equal, and the result is:" + sum);
- }
- else if (biggestNum > sum)
- {
- Console.WriteLine($"Biggest number is: {biggestNum}");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment