Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sortowania przez wstawienie
//Rextester.Program.Main is the entry point for your code. Don't change it. //Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5 using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { //Your code goes here Console.WriteLine("Hello, world!"); int [] a = new int [] {3,1,2,7,4,9}; for ( int i = 1; i < a.Length ; i++ ) { int x = a[i]; // 1 while ( x < a[i-1] ) { int j = a[i-1]; a[i]= a[i-1]; a[i-1] = x; } } /* for ( int i = 0; i < a.Length ; i++) { for ( int k = i+1 ; k < a.Length; k++) { int min = a[i]; if ( a[k] < a[i] ) { min = a[k]; a[k] = a[i]; a [i] = min; } } }*/ foreach(var item in a) { Console.WriteLine(item.ToString()); } } } }
run
|
edit
|
history
|
help
0
Hehd
Milimeters
Welcome
Sorting String Problem need help
time
My Wall
Custom thousand separator
ok
4647
triangular matrix