慕尼黑6021033
2023-07-23 02:04
string[,] t={{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"},{"89","90","98","56","60","91","93","85"}};
int b=0,c=0;
for(int a=0;a<t.GetLongLength(1);a++){
if(Convert.ToInt32(t[1,a])>c){c=Convert.ToInt32(t[1,a]);
b=a;
}
}
Console.Write("分数最高的是{0},分数是{1}",t[0,b],t[1,b]);
using System;
using System.Collections.Generic;
using System.Text;
namespace projAboveAvg
{
class Program
{
static void Main(string[] args)
{
int avg = 0;
int sum = 0;
int[] scores=new int[8]{90,65,88,70,46,81,100,68};
string[] names= new string[8]{"景珍","林惠祥","成蓉","洪南昌","龙玉民","单江开","田武山","王三明"};
foreach(int x in scores){
sum+=x;
}
avg=sum/(names.Length);
Console.Write("平均分是{0},高于平均分的有:",avg);
for(int i=0;i<scores.Length;i++){
if(scores[i]>avg){
Console.Write(names[i]);
}
}
}
}
}
C#开发轻松入门
254117 学习 · 1459 问题
相似问题