int n, m = 0;
Console.WriteLine("阶梯数");
n = Convert.ToInt32(Console.ReadLine());
for (int i = 1; i <=n; i++)
{
if (i< 50)
{
m += i;
}
else
{
m += 10;
}
}
Console.WriteLine("分数:" + m);
Console.ReadKey();
时间: 2024-10-09 04:04:07