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

运行成功,输出也是题目要求的,为什么还是不行

using System.Collections.Generic;

using System.Text;


namespace projGetMaxScore

{

    class Program

    {

        static void Main(string[] args)

        {

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

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


            int max=score[0];


            string firstname=name[0];


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


                if(score[i]>max){


                    max=score[i];


                    firstname=name[i];

                 

                }

            }

          Console.WriteLine($"分数最高的是{firstname}, 分数是{max}");

        }

    }

}


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

个回答