Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Reverse Array (!Array.Reverse())
//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) { int[] source = { 1, 2, 3, 4, 5 }; int[] reversed = ReverseArray(source); foreach (int i in reversed) Console.Write(i.ToString() + " "); } public static int[] ReverseArray(int[] a) { int[] reversed = new int[a.Length]; int index; int j; // reversed index for (index = a.Length - 1, j = 0; index >= 0; index--, j++) { reversed[j] = a[index]; } return a = reversed.ToArray(); } } }
run
|
edit
|
history
|
help
0
Lesson 1.2 Part II
Testing 008
matrix function
ProtectedUse
Número primers
ProgramDemo
adxsdf
asdcsadxasxd
Finally statement called after return
ladly