哪里錯(cuò)了,怎么不能運(yùn)行出來(lái)
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] scores={89,80,98,56,60,91,93,85};
? ? ? ? ? ? string[] names={吳松,錢(qián)東宇,伏晨,陳陸,周蕊,林日鵬,何昆,關(guān)欣};
? ? ? ? ? ? int max=scores[0];
? ? ? ? ? ??
? ? ? ? ? ? for(int i=0;i<8;i++)
? ? ? ? ? ? if(max<scores[i])
? ? ? ? ? ? max=scores[i];
? ? ? ? ? ??
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine(最高分?jǐn)?shù)是"+names[i]+",分?jǐn)?shù)是"+max");
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] scores={89,80,98,56,60,91,93,85};
? ? ? ? ? ? string[] names={吳松,錢(qián)東宇,伏晨,陳陸,周蕊,林日鵬,何昆,關(guān)欣};
? ? ? ? ? ? int max=scores[0];
? ? ? ? ? ??
? ? ? ? ? ? for(int i=0;i<8;i++)
? ? ? ? ? ? if(max<scores[i])
? ? ? ? ? ? max=scores[i];
? ? ? ? ? ??
? ? ? ? ? ? {
? ? ? ? ? ? ? ? Console.WriteLine(最高分?jǐn)?shù)是"+names[i]+",分?jǐn)?shù)是"+max");
? ? ? ? ? ? }
? ? ? ? }
? ? }
}
2017-10-02
if選擇語(yǔ)句里少“{}”大括號(hào)
2017-09-26
scores的數(shù)組不是整數(shù)類(lèi)型的嗎?你用的是string類(lèi)
int [] scores={89,80,98,56,60,91,93,85};
? ? ? ? ? ? string[] names={"吳松","錢(qián)東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int max=scores[0];
? ? ? ? ? ? int index = 0;
? ? ? ? ? ? for (int ?i = 0; i < 8; i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (max < scores[i])
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max = scores[i];
? ? ? ? ? ? ? ? ? ? index = i;
??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ??
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("最高分?jǐn)?shù)是" + names[index] + ",分?jǐn)?shù)是" + max);
2017-09-26
你的“最高分?jǐn)?shù)是”你是不是缺了前面的 ”?這里用的是字符串