Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- namespace Rextester
- {
- public class Program
- {
- public static void Main(string[] args)
- {
- List<int> numbers = new List<int>();//deklaracja i inicjalizacja pustej listy
- while (true)
- {
- int number = Convert.ToInt32(Console.ReadLine());
- if (number == -1)
- {
- foreach (var num in numbers.OrderByDescending(a => a))
- Console.WriteLine(num);
- Console.ReadLine();
- return;
- }
- else
- numbers.Add(number);
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment