c#循环 像正方形一样一直循环 1 2 3 45 67 8 9 2像这样1 2 3 4 6 2 9 8 7 5再5 1 2 3 4 6 2 9 8 7一直循环怎么写?c#循环 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不就是一个环么。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(); } } }}1234629875512346298775123462988751234629987512346229875123466298751234462987512334629875122346298751Press any key to continue . . . 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]+" "); } Console.WriteLine(); } Console.ReadLine(); } dataGridView.CurrentCell.Value无法赋值 框架??? 关于线程的一个问题?? 困惑啊 请教:ashx怎么得到post的包体? 晕啊,电子商务网站项目控制与开发技术,打算寻人合作完成,有提成。 大家来讨论一下如何反馈应用程序操作步骤信息! 刚做完一个站点,散分 .... 急求解决:XML和treeView的问题 C#里有没有类似JavaScript的eval()函数? INI文件的问题 委托和事件 c#连接sql 2005数据库问题
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();
}
}
}
}1234629875
5123462987
7512346298
8751234629
9875123462
2987512346
6298751234
4629875123
3462987512
2346298751
Press any key to continue . . .
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]+" ");
}
Console.WriteLine();
}
Console.ReadLine();
}