Console.Write("请输入您的存款金额:"); decimal saveMoney = decimal.Parse(Console.ReadLine()); Console.Write("请输入您的存款年限:"); int year = int.Parse(Console.ReadLine()); decimal rate; if (year==1) { rate = 0.04m; } else if (year>=2&&year<=5) { rate = 0.048m; } else { rate = 0.052m; } decimal rateMoney=saveMoney*rate*year*10000; decimal extraMoney = 0; if (saveMoney>=50) { extraMoney = rateMoney* 0.1m; } decimal all = rateMoney+ extraMoney; Console.WriteLine("恭喜您,存款成功"+year+"年到期后,您将获得"+all+"元的收益"); Console.ReadLine();