看來半天寫了個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
int sum;
sum=_num1+_num2;//求和
Console.WriteLine("和是{0}",sum);//打印結果
sum=_num1+_num2;//求和
Console.WriteLine("和是{0}",sum);//打印結果
2017-06-21