问答详情
源自:6-1 练习题目

为什么不对?

using System;

using System.Collections.Generic;

using System.Text;


namespace projGetMaxScore

{

    class Program

    {

        static void Main(string[] args)

        {

         int[] score=new int[]{89,90,98,56,60,91,93,85};

         string[] name=new string[]{"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};

         int max=score[0];

         string firstname=name[0];

         for (int i=0;i<score.Length;i++){

             if(score[i]>max){

                 max=score[i];

                 firstname=name[i];

             }

             break;

         }

        }

        Console.Write("分数最高的是{0},分数是{1}",firstname,max);

    }

}


提问者:慕娘80639603 2025-11-19 10:42

个回答