int[] arr = { 1, 2, 3, 4, 5 }; string a=””; string b=””; for (int i = 0; i < arr.Length; i++) {
a=a+arr[i].ToString(); b=b+arr[arr.Length-i-1].ToString(); } Console.WriteLine(a); Console.WriteLine(b);
a=a+arr[i].ToString();
b=b+arr[arr.Length-i-1].ToString();
}
Console.WriteLine(a);
Console.WriteLine(b);
for (int i = 0; i < arr.Length*2; i++){if (i > arr.Length-1){Console.Write(arr[(arr.Length*2-i)-1] + "\t");}else{Console.Write(arr[i]+"\t");}}
int[] arr = { 1, 2, 3, 4, 5 }; for (int i = 0; i < arr.Length * 2; i++) { if (i < arr[arr.Length - 1]) { Console.WriteLine(arr[i]); } else { Console.WriteLine(arr[(arr.Length * 2 - i) - 1]); } }
int[] arr = { 1, 2, 3, 4, 5 };for (int i = 0; i < arr.Length * 2; i++){if (i < arr[arr.Length - 1]){Console.WriteLine(arr[i]);}else{Console.WriteLine(arr[(arr.Length * 2 - i) - 1]);}}
int[] array = { 1, 2, 3, 4, 5 };foreach (int value in array){Console.WriteLine(value);}Array.Reverse(array);foreach (int value in array){Console.WriteLine(value);}Console.ReadLine();
int[] array = { 1, 2, 3, 4, 5 }; foreach (int value in array) { Console.WriteLine(value); } Array.Reverse(array); foreach (int value in array) { Console.WriteLine(value); } Console.ReadLine();