我的代碼運(yùn)行出來了,為什么還是提交過不了
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] name=new string[8];
? ? ? ? ? ? name[0]="吳松";
? ? ? ? ? ? name[1]="錢東宇";
? ? ? ? ? ? name[2]="伏晨";
? ? ? ? ? ? name[3]="陳陸";
? ? ? ? ? ? name[4]="周蕊";
? ? ? ? ? ? name[5]="林日鵬";
? ? ? ? ? ? name[6]="何昆";
? ? ? ? ? ? name[7]="關(guān)欣";
? ? ? ? ? ? int[] score=new int[] {89,90,98,56,60,91,93,85};
? ? ? ? ? ??
? ? ? ? ? ? int max=score[0];
? ? ? ? ? ? int count=0;
? ? ? ? ? ? for(int i=1;i<8;i++ )
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(score[i]>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=score[i];count=i;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分?jǐn)?shù)最高的是"+name[count]+","
? ? ? ? ? ? +"分?jǐn)?shù)是"+score[count]);
? ? ? ? ? ??
? ? ? ? }
? ? }
}
2018-08-24
第一個(gè)類初始值是string,要使用函數(shù)調(diào)用,分?jǐn)?shù)是int類型,會出錯(cuò)
2018-08-24
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[] name = { "吳宋", "錢東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };
? ? ? ? ? ? int[] fenshu = { 89, 90, 98, 56, 60, 91, 93, 85 };? ? ? ? ??
? ? ? ? ? ? int yy= Maxfenshu(fenshu);
? ? ? ? ? ? Console.WriteLine("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}", name[2], yy);
? ? ? ? }
? ? ? ?private static int Maxfenshu(int[] yy)
? ? ? ? {
? ? ? ? ? ?
? ? ? ? ? ? int max = yy[0];
? ? ? ? ? ? for(int i=0;i<yy.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (yy[i] > max)?
? ? ? ? ? ? ? ? max = yy[i];
? ? ? ? ? ? ? ?
? ? ? ? ? ? }
? ? ? ? ? ? return max;
? ? ? ? }
? ? ? ??
? ? }
2018-07-20
通過了,是因?yàn)镃onsole.Write("分?jǐn)?shù)最高的是"+name[count]+","?+"分?jǐn)?shù)是"+score[count]);里輸出的逗號應(yīng)該是中文的,不是英文符號