Run Code
|
API
|
Code Wall
|
Users
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Сортировка массива
//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; namespace Rextester { public class Program { public static void Main(string[] args) { int[] nums = {8, 4, 3, 6, 0, -5,-9}; int temp; for(int i=0; i<nums.Length-1; i++) { for(int j=i+1; j<nums.Length; j++) { if(nums[i] > nums[j]) { temp = nums[i]; nums[i] = nums[j]; nums[j] = temp; } } } foreach(int res in nums) { Console.WriteLine(res); } } } }
run
|
edit
|
history
|
help
0
Please
log in
to post a comment.
How to count the occurrence of each character in a string?
Lp2
Index.cshtml
QuickSort
Pascal's triangle
EX8 Loop_For_While
Abstract Example
12
Simple StackOverflowException
Stack as a queue
Please log in to post a comment.