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 ConsoleApp6
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] a; ;
- Console.WriteLine("Unesi velicinu niza: ");
- int n = Convert.ToInt32(Console.ReadLine());
- a = new int[n];
- for(int i = 0; i < a.Length; i++)
- a[i] = Convert.ToInt32(Console.ReadLine());
- Array.Sort(a);
- Console.WriteLine("Od manjeg ka vecem:");
- for (int i = 0; i < a.Length; i++)
- Console.WriteLine(a[i]);
- Array.Sort(a, (x, y) => y.CompareTo(x));
- Console.WriteLine("Od veceg ka manjem:");
- for (int i = 0; i < a.Length; i++)
- Console.WriteLine(a[i]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement