最新回答 / 慕少0559658
Console.WriteLine()與Console.Write()不同,后者不換行,而前者會(huì)在打印之后換行。這里使用的是WriteLine,會(huì)在打印之后換行,而程序輸出結(jié)果要求不換行,因此把WriteLine改為Write就可以了。
2022-10-21
最新回答 / 甜甜的西瓜皮皮
判斷num[0]是否小于num[x]的數(shù)值,如果小于,則將num[x]的值賦值給num[0],并且將name[x]的值也賦值給name[0]。但在此之前需將本小結(jié)的數(shù)據(jù),創(chuàng)建新的數(shù)組,將姓名和成績(jī)分開(kāi)存儲(chǔ)成數(shù)組。
2022-10-18
最贊回答 / weixin_慕無(wú)忌4124023
string[] name = new string[] { "吳松", "錢(qián)東宇", "伏晨", "陳陸", "周蕊", "林日鵬", "何昆", "關(guān)欣" };? ? ? ? ? ? int[] score = new int[] { 89, 90, 98, 56, 60, 91, 93, 85 };? ? ? ? ? ? int max = score[0];? ? ? ? ? ? string Name = name[0];? ? ? ? ? ? for (int i = 0; i < sc...
2022-10-18
int x = 5;
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
int y = 5;
int z = 5;
Console.Write(++x);
Console.Write(++y);
Console.Write(++z);
2022-10-14
程序先運(yùn)行外部框架,把輸入值為5的程序置于輸出值為6的框架內(nèi)部,使得先運(yùn)行輸出值為6的即可
2022-09-29
{if (x >= 5)
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
{ Console.WriteLine("5");
}
}
else
if (y >= 6)
Console.WriteLine("6");
else
Console.WriteLine("7");
}
}
}
2022-09-29
static void Main(string[] args)
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
{
for(int i=0;i<7;i++)
{
for(int j=0;j<7;j++)
{
char text = (j==i || j==6-i)?'O':'.';
Console.Write(text);
}
Console.WriteLine();
}
2022-09-23
最新回答 / weixin_慕娘0258307
using System;using System.Collections.Generic;using System.Text;namespace projGetMaxScore{? ? class Program? ? {? ? ? ? static void Main(string[] args)? ? ? ? {? ? ? ? string[,]s={{"吳松","89"},{"錢(qián)東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{...
2022-09-08
string[,] list = new string[,]{{"吳松","89"},{"錢(qián)東宇","90"},{"伏晨","98"},{"陳陸","56"},{"周蕊","60"},{"林日鵬","91"},{"何昆","93"},{"關(guān)欣","85"}}; string name = ""; int score = 0;for (int i = 0; i < list.GetLength(0)-1; i++) {if (int.Parse(list[i, 1]) > score) {name = list[i, 0];score = int.Parse(list[i, 1]);}};
2022-09-04
string[,] nameScoreArr = new string[4,2]{{"吳松","89"},{"錢(qián)東","90"},{"周蕊","98"},{"關(guān)欣","78"}};
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
int maxIndex = 0;
for (int x=1;x<nameScoreArr.GetLongLength(0);x++) {
if (int.Parse(nameScoreArr[x,1]) > int.Parse(nameScoreArr[maxIndex,1])) {
maxIndex = x;
}
}
2022-08-29