Adijata

Prva vježba 2013 RPR sedmi zadatak

Oct 10th, 2014
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.79 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApplication9
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.            Console.WriteLine("Unesite broj riječi: ");
  14.             int vel=int.Parse(Console.ReadLine());
  15.  
  16.  
  17.             string[] niz = new string[vel];
  18.             Console.WriteLine("Unesite {0}, riječi", vel);
  19.             for (int i = 0; i < vel; i++)
  20.             {
  21.                 niz[i] = Console.ReadLine();
  22.             }
  23.  
  24.             Array.Sort(niz, delegate(string s1, string s2) { return String.Compare(s1, s2); });
  25.  
  26.             foreach (string i in niz)
  27.                 Console.WriteLine(i);
  28.  
  29.  
  30.                 Console.ReadLine();
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment