Skip to content

Instantly share code, notes, and snippets.

@ruyut
Created March 29, 2019 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruyut/6a4b550f2bab453282f8367b7c275740 to your computer and use it in GitHub Desktop.
Save ruyut/6a4b550f2bab453282f8367b7c275740 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
string[] s = Console.ReadLine().Split(' ');
int[] n = new int[s.Length];
for (int i = 0; i < n.Length; i++)
n[i] = int.Parse(s[i]);
for(int i = 0; i < n.Length; i++)
{
for(int j = 0; j < i; j++)
{
if (n[i] < n[j])
{
int t = n[i];
n[i] = n[j];
n[j] = t;
}
}
}
for(int i = 0; i < n.Length; i++)
Console.Write(n[i] + " ");
Console.Read();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment