命名空间不能直接包含字段或方法之类的成员这个错误怎么搞
usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;usingSy...
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleApplication2{} static void Main(string [] args){ int[,] arr1 = new int[2, 3] { { 1, 2, 3 }, { 4, 5, 6 } }; int[] arr2 = new int[3]; int[] arr3 = new int[3]; for (int i = 0; i < 2; i++) { for(int j=0;j<3;j++) { switch (i) { case 0:arr2[j] = arr1[i, j]; break; case 1:arr3[j] = arr1[i, j]; break; } } } Console.WriteLine("数组一:"); foreach (int n in arr2) Console.Write(n + ""); Console.WriteLine(); Console.WriteLine("数组二:"); foreach (int n in arr3) Console.Write(n + ""); Console.WriteLine();}
展开
- 你的回答被采纳后将获得:
- 系统奖励15(财富值+成长值)+难题奖励30(财富值+成长值)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询