-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path01.SortArrayOFNumbers
More file actions
37 lines (31 loc) · 831 Bytes
/
Copy path01.SortArrayOFNumbers
File metadata and controls
37 lines (31 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
using System;
using System.Collections.Generic;
class joinLists
{
static void Main()
{
string[] arr = Console.ReadLine().Split();
int[] number = new int[arr.Length];
for (int i = 0; i < arr.Length; i++)
{
number[i] = int.Parse(arr[i]);
}
for (int j = 0; j < number.Length; j++)
{
for (int i = 0; i < number.Length - 1; i++)
{
if (number[i] > number[i + 1])
{
int temp = number[i + 1];
number[i + 1] = number[i];
number[i] = temp;
}
}
}
for (int i = 0; i < number.Length; i++)
{
Console.Write(number[i] + " ");
}
Console.WriteLine();
}
}