题目
65岁前能赚多少
代码
Console.WriteLine("请输入当前年龄");
int old = Convert.ToInt32(Console.ReadLine());
Console.WriteLine("请输入当前工资");
Double money = Convert.ToDouble(Console.ReadLine());
Double sum =0;
while (old < 65)
{
old++;
money = money * 1.05;
sum = sum+money;
}
Console.WriteLine("到65岁退休是你可赚{0}", sum);
Console.ReadKey();
网友评论