Advertisement
winone1208

Lista C#

Jul 8th, 2020
803
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace Lista
  5. {
  6.     class Program
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.            
  11.             var lista = new List<int>();
  12.  
  13.             for (int i = 0; i < 5; i++)
  14.             {
  15.                 lista.Add(int.Parse(Console.ReadLine()));
  16.             }
  17.             lista.Sort();
  18.  
  19.             foreach (var nowaZmienna in lista) //wyświetlenie listy
  20.             {
  21.                 Console.WriteLine(nowaZmienna);
  22.             }
  23.  
  24.         }
  25.  
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement