日期:2014-05-18  浏览次数:20810 次

1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26
1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26

以上有两组数,下面的行是正常的。请问各位怎样把第一行所缺的数字找出来?


------解决方案--------------------
//参考代码:

List <Int32> array01 = new List <int> (new int[]{ 1,2,3,4,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,26 });
List <Int32> array02 = new List <int> (new int[]{ 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26 });
List <Int32> result = new List <Int32> ();

for(int i=0;i <array02.Length;i++)
{
if(!array01.Contains(array02[i]))
{
result.Add(array02[i]);
}
}