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;
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] DasArray = new int[20];
- Random RandNum = new Random();
- for (int i = 0; i < DasArray.Length; i++)
- {
- DasArray[i]= RandNum.Next(10,50);
- Console.Write(DasArray[i] + " ");
- }
- Console.WriteLine();
- Ordering(DasArray);
- for (int i = 0; i < DasArray.Length; i++)
- {
- Console.Write(DasArray[i] + " ");
- }
- }
- static void Ordering(int[] Input)
- {
- for (int i = 1; i < Input.Length; i++)
- {
- for (int j = 0; j < Input.Length - i; j++)
- {
- if (Input[j] > Input[j + 1])
- {
- int Temp = Input[j];
- Input[j] = Input[j + 1];
- Input[j + 1] = Temp;
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement