在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
二维数组 int[,] array = new int[3, 4]{ split() 以***进行分割 string s = Console.ReadLine() ; 输入班级人数,
//Console.WriteLine("请输入班级人数:"); //int n = int.Parse(Console.ReadLine()); //double[,] chengji = new double[n, 3]; //for (int i = 0; i < n; i++) //{ // Console.Write("请输入第{0}个学生语文的成绩:", (i + 1)); // chengji[i, 0] = double.Parse(Console.ReadLine()); // Console.Write("请输入第{0}个学生数学的成绩:", (i + 1)); // chengji[i, 1] = double.Parse(Console.ReadLine()); // Console.Write("请输入第{0}个学生英语的成绩:", (i + 1)); // chengji[i, 2] = double.Parse(Console.ReadLine()); //} //for (int j = 0; j < n - 1; j++) //{ // for (int k = j + 1; k < n; k++) // { // if (chengji[j, 0] < chengji[k, 0]) // { // double zhong = chengji[j, 0]; // chengji[j, 0] = chengji[k, 0]; // chengji[k, 0] = zhong; // double zhong1 = chengji[j, 1]; // chengji[j, 1] = chengji[k, 1]; // chengji[k, 1] = zhong1; // double zhong2 = chengji[j, 2]; // chengji[j, 2] = chengji[k, 2]; // chengji[k, 2] = zhong2; // } // } //} //Console.WriteLine("语文成绩最高的两位分别是{0},{1}", chengji[0, 0], chengji[1, 0]); //for (int w = 0; w < n - 1; w++) //{ // for (int y = w + 1; y < n; y++) // { // if (chengji[w, 1] < chengji[y, 1]) // { // double zhong = chengji[w, 0]; // chengji[w, 0] = chengji[y, 0]; // chengji[y, 0] = zhong; // double zhong1 = chengji[w, 1]; // chengji[w, 1] = chengji[y, 1]; // chengji[y, 1] = zhong1; // double zhong2 = chengji[w, 2]; // chengji[w, 2] = chengji[y, 2]; // chengji[y, 2] = zhong2; // } // } //} //Console.WriteLine("数学成绩最低的两位分别是{0},{1}", chengji[n - 1, 1], chengji[n - 2, 1]); //double sum = 0; //for (int k = 0; k < n; k++) //{ // sum = sum + chengji[k, 2]; //} //Console.WriteLine("英语平均分是:{0}", (sum / n));
//随意输入20个数字,放入数组, //Random ran=new Random(); //int[]aa=new int[20]; //int[]bb=new int[10]; //for (int i = 0; i < 20;i++) //{ // aa[i] = ran.Next(); //} //foreach(int cc in aa) //{ // Console.WriteLine(cc); //} //Console.Write("请按回车键继续。"); //Console.ReadLine(); //for (int j = 0; j < 10;j++ ) //{ // bb[j]=aa[j*2+1]; //} //foreach(int dd in bb) //{ // Console.WriteLine(dd); //}
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论