課程
/后端開發(fā)
/C#
/C#開發(fā)輕松入門
Console.WriteLine("分?jǐn)?shù)最高的是伏晨,分?jǐn)?shù)是98");
2019-03-11
源自:C#開發(fā)輕松入門 6-1
正在回答
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[,] names = new string[,] { { "吳松", "89" }, { "錢東宇", "90" }, { "伏晨", "98" }, { "陳陸", "56" }, { "周蕊", "60" }, { "林日鵬", "91" }, { "何昆", "93" }, { "關(guān)欣", "85" } };
? ? ? ? ? ? string student = "None";
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? for (int i=0;i<8;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? int text= Convert.ToInt32(names[i, 1]);
? ? ? ? ? ? ? ? string name = names[i,0];
? ? ? ? ? ? ? ? if(text>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=text;
? ? ? ? ? ? ? ? ? ? student=name;
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("最高分?jǐn)?shù)的是"+student+",分?jǐn)?shù)是"+max+"。");
? ? ? ? }
? ? }
? ??
}
? ? ? ? ? ? string []name={"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int [] grades= {89,90,98,56,60,91,93,85};
? ? ? ? ? ? int k=0;
? ? ? ? ? ? int max = grades[0];
? ? ? ? ? ? for (int i=0;i<grades.Length;i++)
? ? ? ? ? ? ? ? if (grades[i]>max)
? ? ? ? ? ? ? ? ? ? max=grades[i];
? ? ? ? ? ? ? ? ? ? k=i;
? ? ? ? ? ??
? ? ? ? ? ? Console.WriteLine("最高分?jǐn)?shù)的是"+name[k]+",分?jǐn)?shù)是"+max+"。");
你好厲害啊?
舉報(bào)
本門課程是C#語言的入門教程,將帶你輕松入門.NET開發(fā)
2 回答對了幾遍12行就是出不來。求幫忙。
2 回答為什么每次打開都要花十幾分鐘甚至幾十分鐘重新更新呢?
2 回答這個(gè)怎么用visaul2012做出來啊
1 回答怎么忽然就進(jìn)入到視頻里面了呢?原來的看頁面+做題的方式更適合我......... 這看視頻,都來不及想明白,就過去了
4 回答原程序打印出來的是哪幾個(gè)數(shù)字???
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號-11 京公網(wǎng)安備11010802030151號
購課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號
2019-03-12
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string[,] names = new string[,] { { "吳松", "89" }, { "錢東宇", "90" }, { "伏晨", "98" }, { "陳陸", "56" }, { "周蕊", "60" }, { "林日鵬", "91" }, { "何昆", "93" }, { "關(guān)欣", "85" } };
? ? ? ? ? ? string student = "None";
? ? ? ? ? ? int max = 0;
? ? ? ? ? ? for (int i=0;i<8;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? int text= Convert.ToInt32(names[i, 1]);
? ? ? ? ? ? ? ? string name = names[i,0];
? ? ? ? ? ? ? ? if(text>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=text;
? ? ? ? ? ? ? ? ? ? student=name;
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("最高分?jǐn)?shù)的是"+student+",分?jǐn)?shù)是"+max+"。");
? ? ? ? }
? ? }
? ??
}
2019-03-12
using System;
using System.Collections.Generic;
using System.Text;
using System.Collections;
namespace projGetMaxScore
{
? ? class Program
? ? {
? ? ? ? static void Main(string[] args)
? ? ? ? {
? ? ? ? ? ? string []name={"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};
? ? ? ? ? ? int [] grades= {89,90,98,56,60,91,93,85};
? ? ? ? ? ? int k=0;
? ? ? ? ? ? int max = grades[0];
? ? ? ? ? ? for (int i=0;i<grades.Length;i++)
? ? ? ? ? ? {
? ? ? ? ? ? ? ? if (grades[i]>max)
? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? max=grades[i];
? ? ? ? ? ? ? ? ? ? k=i;
? ? ? ? ? ? ? ? ? ??
? ? ? ? ? ? ? ? }
? ? ? ? ? ??
? ? ? ? ? ? }
? ? ? ? ? ? Console.WriteLine("最高分?jǐn)?shù)的是"+name[k]+",分?jǐn)?shù)是"+max+"。");
? ? ? ? ? ??
? ? ? ? ? ??
? ? ? ? ? ??
? ? ? ? }
? ? }
2019-03-11
你好厲害啊?