int[] arr1 = { 5, 4, 3, 2, 1 };
int[] arr2 = { 1, 2, 4, 5 };
for (int i = 0; i < arr1.Length; i++)
{
for (int j = 0; j < arr2.Length; j++)
{
if (arr1[i] == arr2[j])
{
//Console.Write(arr1[i]);
}
}
}
上述代码的输出:
5,4,2,1
我想要输出:
3