最新回答 / qq_半城浮華_0
using System;using System.Collections.Generic;using System.Text;namespace projAboveAvg{? ? class Program? ? {? ? ? ? static void Main(string[] args)? ? ? ? {? ? ? ? ? ? int avg = 0;? ? ? ? ? ? int sum = 0;? ? ? ? ? ? int[] scores=new int[8]{90,65,88,70,46...
2023-07-23
string[,] t={{"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"},{"89","90","98","56","60","91","93","85"}};
int b=0,c=0;
for(int a=0;a<t.GetLongLength(1);a++){
if(Convert.ToInt32(t[1,a])>c){c=Convert.ToInt32(t[1,a]);
b=a;}}
Console.Write("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",t[0,b],t[1,b]);
int b=0,c=0;
for(int a=0;a<t.GetLongLength(1);a++){
if(Convert.ToInt32(t[1,a])>c){c=Convert.ToInt32(t[1,a]);
b=a;}}
Console.Write("分?jǐn)?shù)最高的是{0},分?jǐn)?shù)是{1}",t[0,b],t[1,b]);
2023-07-23
if (score[i] < 60)//如果有不及格的
{
//記錄有不及格的
hasNopass=true;
break;
}
}
{
//記錄有不及格的
hasNopass=true;
break;
}
}
2023-06-24
int[] num = new int[] {3,34,42,2,11,19,30,55,20};
for(int i=0; i<num.Length; i++)//i<num.Length是因?yàn)樗饕?-8,數(shù)組長(zhǎng)度為9。所以 i<=num.Length錯(cuò)誤
{
if(num[i] % 2 == 0)//打印偶數(shù)
Console.Write(num[i] + ",");
}
for(int i=0; i<num.Length; i++)//i<num.Length是因?yàn)樗饕?-8,數(shù)組長(zhǎng)度為9。所以 i<=num.Length錯(cuò)誤
{
if(num[i] % 2 == 0)//打印偶數(shù)
Console.Write(num[i] + ",");
}
2023-06-24
string[] job = new string[4] { "經(jīng)理", "項(xiàng)目主管", "技術(shù)總監(jiān)", "財(cái)務(wù)主管" };//方法一
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i] + "");//打印職位
}
for (int i = 0; i < job.Length; i++)
{
Console.Write(job[i] + "");//打印職位
}
2023-06-24
最新回答 / 慕慕8394392
? ? ? ? ? ? string[] name=new string[8]? ? ? ? ? ? {"吳松","錢東宇","伏晨","陳陸","周蕊","林日鵬","何昆","關(guān)欣"};?? ? ? ? ? ? int[] score =new int[8]{99,90,98,56,60,91,93,85};? ? ? ? ? ? int max = score[0];? ? ? ? ? ? int j = 0;? ? ? ? ? ? for(int i=0;i<score.Length;i++...
2023-06-07
最贊回答 / qq_慕雪4435505
using System;using System.Collections.Generic;using System.Text;namespace Test{? ? class Program? ? {? ? ? ? static void Main(string[] args)? ? ? ? {? ? ? ? ? ? //請(qǐng)完善代碼? ? ? ? ? ? for(int i=0;i<7;i++)? ? ? ? ? ? {? ? ? ? ? ? ? ? for(int j=0;j<7;j++)...
2023-06-07
最新回答 / wulitan
語(yǔ)句`Console.write((double)3)`中的`(double)`表示將整型3強(qiáng)制轉(zhuǎn)換成雙精度浮點(diǎn)型,所以實(shí)際上3已經(jīng)被轉(zhuǎn)換成了3.0。但是`Console.write()`默認(rèn)輸出時(shí)不會(huì)顯示小數(shù)點(diǎn)及后面的0,因此輸出的是3而非3.0。若要輸出3.0,可以使用`Console.WriteLine()`方法并指定輸出格式,例如:```Console.WriteLine("{0:F1}", (double)3);```其中的`{0:F1}`表示格式化輸出第一個(gè)參數(shù)(即強(qiáng)制轉(zhuǎn)換后的3),保留一位小...
2023-05-16
for(int x=1;x<=7;x++)
{
for(int y=1;y<=7;y++)
{ Console.Write(x==y||x+y==8?"O":".");
}
Console.WriteLine();//請(qǐng)完善代碼
}
{
for(int y=1;y<=7;y++)
{ Console.Write(x==y||x+y==8?"O":".");
}
Console.WriteLine();//請(qǐng)完善代碼
}
2023-03-24