阅读背景:

循环两个列表后,如何在一次迭代后停止内循环?

来源:互联网 

Here's my code:

这是我的代码:

List<int> myValues = new List<int>(new int[] { 5, 9, 3, 4, 7, 12, 0, 15 });
List<int> newOnly = new List<int>(new int[] { 5, 7, 1, 11, 7, 19, 76, 18 });
List<int> newValues = new List<int>();

for (int i = 0; i < myValues.Count; i++){
    for (int x = 0; x < newOnly.Count; x++){
        if (!myValues.Contains(newOnly[x])){
                        newValues.Add(newOnly[x]);
        }
    }
}
List<int> myValues 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: