switch (job)
{
case "局长": Console.Write("发双黄月饼");break;
case "处长": Console.Write("发蛋黄月饼");break;
case "科长": Console.Write("发枣泥月饼");break;
default : Console.Write("发五仁月饼"); break;
}
{
case "局长": Console.Write("发双黄月饼");break;
case "处长": Console.Write("发蛋黄月饼");break;
case "科长": Console.Write("发枣泥月饼");break;
default : Console.Write("发五仁月饼"); break;
}
2017-09-28
看了半天原来跟我写的一样啊0.0
int maxpeople = 0;
int maxscore = 0;
for(int i = 0 ;i<score.Length;i++){
if (score[i]>maxscore){
maxscore = score[i];
maxpeople = i;
}
int maxpeople = 0;
int maxscore = 0;
for(int i = 0 ;i<score.Length;i++){
if (score[i]>maxscore){
maxscore = score[i];
maxpeople = i;
}
2017-09-28
string[]names={"A","B","C","D","E","F","G"};
int[] score = new int[] {89,39,100,51,94,65,70 };
Console.Write("不及格的有:");
for (int i = 0; i <names.Length ; i++)
{
if(score[i]<60 )
Console.Write(names[i]+",");
}
int[] score = new int[] {89,39,100,51,94,65,70 };
Console.Write("不及格的有:");
for (int i = 0; i <names.Length ; i++)
{
if(score[i]<60 )
Console.Write(names[i]+",");
}
2017-09-27