Step 1: Create a C # console Project
Step 2: Compile the corresponding encoding implementation as follows:
Class Program
{
Static void main (string [] ARGs)
{
Int [] array = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
Reverse (array );
Console. Read ();
}
Static void reverse (INT [] array)
{
For (INT I = 0; I <array. length; I ++)
{
Console. Write (array [I]. tostring () + ",");
}
Console. writeline ();
Int temp;
For (Int J = 0; j <array. Length/2; j ++)
{
Temp = array [J];
Array [J] = array [array. Length-J-1];
Array [array. Length-J-1] = temp;
}
For (int K = 0; k <array. length; k ++)
{
Console. Write (array [K]. tostring () + ",");
}
}
}
Conclusion: although such a simple algorithm is difficult for many new interviewers, they are used to copying and pasting others' code on the Internet, but gradually forget to think about the problem by themselves, although the ability to solve problems means that imitating others is a great creation, or a great copy of the article in the world, you will not copy it. One thing we must remember is to learn to think.