快捷导航

帮忙看看哪不对 vs运行是对的

using System;using System.Collections.Generic;using System.Text;namespace Test{  class Program  {    static void Main(string[] args)    {      string [] name = new string[8] {"吴松","钱东宇","伏晨","陈陆","周蕊","林日鹏","何昆","关欣"};      int[] score=new int[8]{89,90,98,56,60,91,93,85};      int temp=0;      int x = 0;      for (int i = 1; i < score.Length; i++)      {        if (score > temp)        {          temp = score;          x = i;        }      }      Console.Write("分数最高的是{0},分数是{1}",name[x],temp);      Console.WriteLine();    }  }}

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员2

首先for循环循环变量i从0开始;其次为减少代码量可以将write→writeline 并去掉最后的换行。
回复

使用道具 举报

VS上运行是对的,那逻辑就没什么问题。你看看是不是标点符号(分中文、英文),或者空格不符合题目要求。其实这都不重要,VS运行OK就可以了
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP