Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace @new
- {
- class Program
- {
- public static void Main()
- {
- string numbers = Console.ReadLine();
- char[] arr1 = numbers.Replace(" ", string.Empty).Replace(",", string.Empty).ToCharArray();
- int[] arr = new int[arr1.Length];
- for (int i = 0; i < arr1.Length; i++)
- {
- arr[i] = Convert.ToInt32(new string(arr1[i], 1));
- }
- int temp;
- for (int i = 0; i < arr.Length - 1; i++)
- for (int j = i + 1; j < arr.Length; j++)
- if (arr[i] < arr[j])
- {
- temp = arr[i];
- arr[i] = arr[j];
- arr[j] = temp;
- }
- for (int i = 0; i < arr.Length; i++)
- {
- Console.Write($"{i}, ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement