- static void QureyString()
- {
- int[] MyData=new int[]{10,50,60};
- var NewData=from n in MyData
- where n>100
- select n;
- int sum1=0;
- foreach(var m in NewData)
- {
- sum1+=m;
- }
- MyData[0]=120;
- MyData[1]=180;
- int sum2=0;
- foreach(var m in NewData)
- {
- sum2+=m;
- }
- }
复制代码 QureyString执行退出前Num1和Num2的值分别为多少? |