好像还有其他方式 看到网友写max,max 是关键字吗?
namespace test
{
class Program
{
static void Main(string[] args)
{
string[] name = { "吴松", "钱东宇", "伏晨", "陈陆", "周蕊", "林日鹏", "何昆", "关欣" };
int[]score = { 89, 90, 98, 56, 60, 91, 93, 85 };
int t = 0;
string r = "";
for (int i = 0; i < score.Length; i++)
{
if (score[i] > t)
t = score[i];
r = name[i];
}
Console.WriteLine("分数最高的是-" + r + "," );
Console.WriteLine("分数是-" + t);
}
}
}