Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- internal class Program
- {
- static void Main(string[] args)
- {
- int[] numbers = new int[10];
- int buffer;
- int minRandom = 0;
- int maxRandom = 101;
- Random random = new Random();
- for (int i = 0; i < numbers.Length; i++)
- {
- numbers[i] = random.Next(minRandom, maxRandom);
- Console.Write(numbers[i] + " ");
- }
- Console.WriteLine("\nСОРТИРОВКА..ПУП.... ПИП ..ПУ.. ГОТОВО:");
- for (int i = 0; i < numbers.Length; i++)
- {
- for (int j = 0; j < numbers.Length - 1; j++)
- {
- if (numbers[j] > numbers[j + 1])
- {
- buffer = numbers[j];
- numbers[j] = numbers[j + 1];
- numbers[j + 1] = buffer;
- }
- }
- }
- foreach (int number in numbers)
- {
- Console.Write(number + " ");
- }
- Console.ReadKey();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement