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[i] > temp)? ? ? ? ? ? ? ? {? ? ? ? ? ? ? ? ? ? temp = score[i];? ? ? ? ? ? ? ? ? ? x = i;? ? ? ? ? ? ? ? }? ? ? ? ? ? }? ? ? ? ? ? Console.Write("分數(shù)最高的是{0},分數(shù)是{1}",name[x],temp);? ? ? ? ? ? Console.WriteLine();? ? ? ? }? ? }}
4 回答

qq_對我而言可愛的你_04181735
TA貢獻1條經(jīng)驗 獲得超1個贊
VS上運行是對的,那邏輯就沒什么問題。你看看是不是標點符號(分中文、英文),或者空格不符合題目要求。其實這都不重要,VS運行OK就可以了
- 4 回答
- 0 關注
- 1374 瀏覽
添加回答
舉報
0/150
提交
取消