Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Swap adjacent Elements
//Rextester.Program.Main is the entry point for your code. Don't change it. //Microsoft (R) Visual C# Compiler version 2.9.0.63208 (958f2354) using System; using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; namespace Rextester { public class Program { public static void Main(string[] args) { int[] arr = {1,2,3,4,5}; int i =0; while (i < arr.Length - 1) { var temp = arr[i]; arr[i] = arr[i+1]; arr[i+1] = temp; i = i +2; } foreach(var a in arr) { Console.WriteLine(a); } } } }
run
|
edit
|
history
|
help
1
stack with stack Data type
bellman ford algo
asxasxdf
FIBNOCHI
merge 2 sorted array
sdfghuyhtgrfedwsx
Sum
Write a program to count the occurrence of each distinct item in the array?
Use ConcurrentQueue and ConcurrentDictionary with TPL (Simple example)
Оператор switch