while (true)
{
Console.Write("请输入你的楼梯数:");
int n = Convert.ToInt32(Console.ReadLine());
int fenshu = 0;
if (n > 100)
{
Console.WriteLine("您输入的楼梯数有误!");
}
else
{
for (int i = 1; i <= n; i++) //根据输入的楼梯数来循环
{
if (n< 50) //加条件,在50节楼梯以下怎么计算得分
{
fenshu = n;
}
else
{
//fenshu = 49 + (n - 49) * 10;
fenshu = n * 10;
}
}
Console.WriteLine("爬" + n + "个楼梯,您的得分是" + fenshu);
}