#编码
Console.WriteLine("输入本金");
string str_p = Console.ReadLine();
Console.WriteLine("输入利率");
string str_r = Console.ReadLine();
Console.WriteLine("输入年份");
string str_n = Console.ReadLine();
try
{
double p = Convert.ToDouble(str_p);
double r = Convert.ToDouble(str_r);
int n = Convert.ToInt32(str_n);
int i = 1;
while (i <= n)
{
p *= r+1;
Console.WriteLine("你第{0}年的钱是{1}",i,p);
i++;
}
}
catch
{
Console.WriteLine("输入错误");
}
Console.ReadKey();