数组的问题,哪儿出问题了,该怎么弄?
using System;using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace weizhi
{
class Program
{
static void Main(string[] args)
{
int[,]s1 = new int[,]{{45,23},{1,2},{8,9}};
int[,]s2 = new int[,]{{ 4,23},{10,20},{7,9}};
int i,j;
string output="";
foreach (int a in s1)
{
for(i=0;i<4;++i)
for (j = 0; j < 2; ++j)
{
if (a == s2[i,j])
goto done;
}
done: output += string.Format("找到{0}位置[{1}][{2}]")+"\n";
output+=string.Format("没有找到{0}位置[{1}][{2}]");
MessageBox.Show(output);
}
}
}
}