期中作业2

int count = 0;

int n = 1;

string answer;

do

{

Console.Write("您正在玩第{0}局,成绩为:", n);

string str_score = Console.ReadLine();

int score = Convert.ToInt32(str_score);

if (score > 80)

{

count++;

}

n++;

if (n > 5)

{

Console.WriteLine("游戏结束");

}

else

{

Console.Write("\n继续玩下一局吗?(yes/no)");

answer = Console.ReadLine();

if ("no" == answer)

{

Console.Write("\n您已经中途退出程序了");

break;

}

else

{

Console.WriteLine("进入一局");

}

}

你可能感兴趣的:(期中作业2)