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 _02SelectSort
- {
- class _02SelectSort
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int min = arr[0];
- int temp = 0;
- for (int j = 0; j < arr.Length-1; j++)
- {
- min = j;
- for (int i = j+1; i < arr.Length; i++)
- {
- if (arr[i] < arr[min])
- {
- temp=arr[min];
- arr[min] = arr[i];
- arr[i] = temp;
- }
- }
- }
- foreach (var item in arr)
- {
- Console.Write(item + " ");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement