日期:2014-05-17 浏览次数:20852 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
int[] data = { 1, 2, 3, 4, 6, 2, 9, 8, 7, 5 };
for (int i = 0; i < data.Length; i++)
{
int pos = data.Length - i % data.Length;
int[] current = data.Skip(pos).Take(data.Count() - pos).Concat(data.Take(pos)).ToArray();
foreach (int x in current) Console.Write(x);
Console.WriteLine();
}
}
}
}
static void Main(string[] args)
{
int[] data = { 1, 2, 3, 4, 6, 2, 9, 8, 7, 5 };
for (int i = 0; i < data.Length; i++)
{
for (int j = 0; j < data.Length; j++)
{
Console.Write(data[(data.Length - i + j) % data.Length]+" ");
}
&