這個怎么樣嗎
using System;
using System.Collections.Generic;
using System.Text;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {? ?
? ? ? ? ? ? string [,]Data=
? ? ? ? ? ? {
? ? ? ? ? ? ? ? {"吳松","89"},
? ? ? ? ? ? ? ? {"錢東宇","90"},
? ? ? ? ? ? ? ? {"伏晨","98"},
? ? ? ? ? ? ? ? {"陳陸","56"},
? ? ? ? ? ? ? ? {"周蕊","60"},
? ? ? ? ? ? ? ? {"林日鵬","91"},
? ? ? ? ? ? ? ? {"何昆","93"},
? ? ? ? ? ? ? ? {"關欣","85"}
? ? ? ? ? ? };
? ? ? ? ? ? int y=int.Parse(Data[0,1]);
? ? ? ? ? ? int z=0;
? ? ? ? ? ? for(int x=0;x<Data.GetLongLength(0);x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(y<int.Parse(Data[x,1]))
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? y=int.Parse(Data[x,1]);
? ? ? ? ? ? ? ? ? ? z=x;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分數(shù)最高的是{0},分數(shù)是{1}",Data[z,0],Data[z,1]);
? ? ? ? }
? ? }
2019-06-04
數(shù)組聲明和賦值兩種都可以的
2019-05-16
? ?string [,]Data=new string [,]
? ? ? ? ? ? {
? ? ? ? ? ? ? ? {"吳松","89"},
? ? ? ? ? ? ? ? {"錢東宇","90"},
? ? ? ? ? ? ? ? {"伏晨","98"},
? ? ? ? ? ? ? ? {"陳陸","56"},
? ? ? ? ? ? ? ? {"周蕊","60"},
? ? ? ? ? ? ? ? {"林日鵬","91"},
? ? ? ? ? ? ? ? {"何昆","93"},
? ? ? ? ? ? ? ? {"關欣","85"}
? ? ? ? ? ? };
? ? ? ? ? ? int y=int.Parse(Data[0,1]);
? ? ? ? ? ? int z=0;
? ? ? ? ? ? for(int x=0;x<Data.GetLongLength(0);x++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if(y<int.Parse(Data[x,1]))
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? y=int.Parse(Data[x,1]);
? ? ? ? ? ? ? ? ? ? z=x;
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.Write("分數(shù)最高的是{0},分數(shù)是{1}",Data[z,0],Data[z,1]);
? ? ? ? }
數(shù)組聲明和賦值語法錯誤了