using System; class MainClass { static void Println(int[] a) { for (int i = 0; i < a.Length; i++) Console.Write(a[i] + " "); Console.WriteLine(); } static void Main() { var a = new int[100]; var r = new Random(); for (int i = 0; i < 100; i++) a[i] = r.Next(200) - 100; Println(a); Console.WriteLine(); Array.Sort(a); Println(a); Console.ReadKey(); } }
Answers & Comments
using System;
class MainClass {
static void Println(int[] a) {
for (int i = 0; i < a.Length; i++) Console.Write(a[i] + " ");
Console.WriteLine();
}
static void Main() {
var a = new int[100];
var r = new Random();
for (int i = 0; i < 100; i++) a[i] = r.Next(200) - 100;
Println(a); Console.WriteLine();
Array.Sort(a); Println(a);
Console.ReadKey();
}
}
Пример: