Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Text.RegularExpressions;
- namespace prostoChislo
- {
- class Program
- {
- static void Main(string[] args)
- {
- int[] arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
- int[] sortedArray = new int[arr.Length];
- for (int i = 0; i < arr.Length; i++)
- {
- int currmax = int.MinValue;
- int maxIndex = i;
- for (int j = 0; j <arr.Length; j++)
- {
- if (currmax<arr[j])
- {
- currmax = arr[j];
- maxIndex = j;
- }
- }
- sortedArray[i] = currmax;
- arr[maxIndex] = int.MinValue;
- }
- Console.WriteLine(string.Join(" ",sortedArray));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement