using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 };
Console.WriteLine("顺序输出");
for (int i = 0; i < a.Length; i++)
{
Console.Write("{0} ", a[i]);
}
Console.WriteLine();
Console.WriteLine("逆序输出");
for (int i = a.Length - 1; i >= 0; i--)
{
Console.Write("{0} ", a[i]);
}
}
}
}
123456789101112131415161718192021222324252627282930using System;using System.Text;using System.Collections.Generic;using System.Linq; namespace ConsoleApplication1{ class Program { static void Main(string[] args) { int[] a = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0 }; Console.WriteLine("顺序输出"); for (int i = 0; i < a.Length; i++) { Console.Write("{0} ", a[i]); } Console.WriteLine(); Console.WriteLine("逆序输出"); for (int i = a.Length - 1; i >= 0; i--) { Console.Write("{0} ", a[i]); } } }}