string[] info = new string[] {"p","j","k","m"};
int[] score = new int[] { 12,103,24,31};
int maxScore = score[0],maxindex = 0;
for (int x = 1; x < score.Length; x++) {
if (maxScore < score[x]) {
maxScore = score[x];
maxindex = x;
}
}
Console.Write("name: "+info[maxindex]+"'s score is : "+maxScore);
int[] score = new int[] { 12,103,24,31};
int maxScore = score[0],maxindex = 0;
for (int x = 1; x < score.Length; x++) {
if (maxScore < score[x]) {
maxScore = score[x];
maxindex = x;
}
}
Console.Write("name: "+info[maxindex]+"'s score is : "+maxScore);
最赞回答 / 一念征途
你好,这个题目 可以分成2个数组来写,也可以直接用一个二维数组来写。我看你的代码,应该是用二维数组写的。那我说下二维数组的原理: 先声明一个二维数组[8,2]. 第一位是放名字,第二位...
2017-06-24
定义常量:
const 关键字,表明PI是一个常量; double 关键字,表明PI的类型为“双精度浮点型”(一种精度很高的数字类型)。如:
const double PI=3.1415926;
const 关键字,表明PI是一个常量; double 关键字,表明PI的类型为“双精度浮点型”(一种精度很高的数字类型)。如:
const double PI=3.1415926;
最赞回答 / 一念征途
你好,有时会因为网络繁忙等原因,代码会提交不上,可以隔断时间再提交试试,多提交几次就可以了。如果需要检查下你的代码正不正确,可以安装个visual studio(简称VS),在visual studio上运行看下结果。祝你学习顺利!
2017-06-24
对这个题的答案持怀疑态度。
int y=5;
console.write(y++);的结果应该是6,y++应该是先自加再输出,
结果这个题的正确答案竟然是把y++改成++y,难以理解。
int y=5;
console.write(y++);的结果应该是6,y++应该是先自加再输出,
结果这个题的正确答案竟然是把y++改成++y,难以理解。
2017-06-23
最赞回答 / 一念征途
你好,有时会因为网络繁忙,代码会提交不上,可以隔断时间再提交试试。如果需要检查下你的代码正不正确,可以安装个visual studio(简称VS),在visual studio上运行看下结果。祝你学习顺利!
2017-06-22
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job ={"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]+"");//打印职位
}
}
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
string[] job ={"经理","项目主管","技术总监","财务主管"};
for (int i = 0; i < job.Length ; i++)
{
Console.Write(job[i]+"");//打印职位
}
}
2017-06-21
int sum;
sum=_num1+_num2;//求和
Console.WriteLine("和是{0}",sum);//打印结果
sum=_num1+_num2;//求和
Console.WriteLine("和是{0}",sum);//打印结果
2017-06-21
已采纳回答 / 残雨無痕
for (int i = 1; i < 8; i++)
{ for (int j = 1; j < 8; j++)
{
if (i == j || i + j == 8)
Console.Write("0");
else
Console.Write(".");
}
...
2017-06-20