看来半天写了个b=true 看下面的评论,我去b=a......................................机智如你
2017-06-25
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);
定义常量:
const 关键字,表明PI是一个常量; double 关键字,表明PI的类型为“双精度浮点型”(一种精度很高的数字类型)。如:
const double PI=3.1415926;
const 关键字,表明PI是一个常量; double 关键字,表明PI的类型为“双精度浮点型”(一种精度很高的数字类型)。如:
const double PI=3.1415926;
对这个题的答案持怀疑态度。
int y=5;
console.write(y++);的结果应该是6,y++应该是先自加再输出,
结果这个题的正确答案竟然是把y++改成++y,难以理解。
int y=5;
console.write(y++);的结果应该是6,y++应该是先自加再输出,
结果这个题的正确答案竟然是把y++改成++y,难以理解。
2017-06-23
{
//声明“职位”数组,初始化为:"经理","项目主管","技术总监","财务主管"
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