Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sortowania przez wstawienie Correct
//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 [] {6,5,4,3,2,1}; for ( int i = 1; i < a.Length ; i++ ) { int x = a[i]; int j = i ; while ( j>=1 && x < a[j-1]) { a[j]= a[j-1]; a[j-1] = x; j=j-1; } } /* 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
1
lookup test
foreach
binary
Fortnite Generator
655+99
makingNum
test1
compiled prog
Asignacion 692018