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;
- class Program
- {
- static void Main()
- {
- string[] stringList = Console.ReadLine().Split(' ');
- int[] intList = new int[stringList.Length];
- int temp;
- for (int i = 0; i < stringList.Length; i++) //converting array loop(string to int)
- {
- temp = int.Parse(stringList[i]);
- intList[i] = temp;
- }
- for (int k = 0; k < intList.Length; k++) //sorting array loop
- {
- for (int n = 0; n < k; n++)
- {
- if (intList[n] < intList[k])
- {
- temp = intList[k];
- intList[k] = intList[n];
- intList[n] = temp;
- }
- }
- }
- for (int j = 0; j < intList.Length; j++) //converting array loop (int to string)
- {
- temp = intList[j];
- stringList[j] = Convert.ToString(temp);
- }
- string output = string.Join(", ", stringList);
- Console.WriteLine(output);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement