简单问题请教 如何用c#输出一个二维数组啊 输出如:int [,] array=new int[4,4] { {},{} ,{} ```}; for(){for {} Console.writeLine();}1 2 3 47 8 9 43 6 8 67 5 6 1 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 int[,]ary={{1,2,3,4},{5,6,7,8},.....};估计成吧 void Main(){ int [,] array=new int[4,4] { {1,2,3,4},{7,8,9,4} ,{3,6,8,6},{7,5,6,1}}; int m=0; foreach(int i in array) { m++; Console.Write(i+" "); if(m%4==0) { Console.Write("\r\n"); } } }/*1 2 3 4 7 8 9 4 3 6 8 6 7 5 6 1 */ [code=C#] int [,] array=new int[4,4]{{1,2,3,4},{5,6,7,8},{2,3,4,5},{7,5,4,5}}; for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) Console.Write(array[i, j] + "\t"); Console.WriteLine(""); } Console.Read();code] int [,] array=new int[4,4]{{1,2,3,4},{5,6,7,8},{2,3,4,5},{7,5,4,5}}; for (int i = 0; i < array.GetLength(0); i++) { for (int j = 0; j < array.GetLength(1); j++) Console.Write(array[i, j] + "\t"); Console.WriteLine(""); } Console.Read();//结果: 1 2 3 4 5 6 7 8 2 3 4 5 7 5 4 5 c#控制台程序中输入数字出错 DropDownList数据绑定 126邮箱的批量上传功能 怎么通过unicode码查询到字符(汉字,日文等。。)? 几个简单问题 敬请 理论高手解答:C#为什么叫C#,#为什么读sharp 求Xpath表达式用法 请高手指点一个问题!谢谢先!!!(txtbox的内容怎么写入数据库中表的指定列) 请教 MSSQL登陆的问题 集成身份验证与混合模式验证 请问从windows窗体中拖此人意思他crystalreportviewer组件时出错 access 提示至少一个参数没有被指定值 C# 如何绘制出弧形的图片. 关于c# winform 应用程序校验问题
估计成吧
void Main()
{
int [,] array=new int[4,4] { {1,2,3,4},{7,8,9,4} ,{3,6,8,6},{7,5,6,1}};
int m=0;
foreach(int i in array)
{
m++;
Console.Write(i+" ");
if(m%4==0)
{
Console.Write("\r\n");
}
}
}/*
1 2 3 4
7 8 9 4
3 6 8 6
7 5 6 1 */
for (int i = 0; i < array.GetLength(0); i++)
{
for (int j = 0; j < array.GetLength(1); j++)
Console.Write(array[i, j] + "\t");
Console.WriteLine("");
}
Console.Read();code]
int [,] array=new int[4,4]{{1,2,3,4},{5,6,7,8},{2,3,4,5},{7,5,4,5}};
for (int i = 0; i < array.GetLength(0); i++)
{
for (int j = 0; j < array.GetLength(1); j++)
Console.Write(array[i, j] + "\t");
Console.WriteLine("");
}
Console.Read();
//结果:
1 2 3 4
5 6 7 8
2 3 4 5
7 5 4 5