美文网首页
2018-11-08作业

2018-11-08作业

作者: 邙川 | 来源:发表于2018-11-08 10:38 被阅读0次

{//*估计一个职员在65岁退休之前能赚到多少钱。用年龄和超始薪水作为输入,并假设职员每年工资增长5%。

        Console.WriteLine("请输入你的年龄");
        int year = Convert.ToInt32(Console .ReadLine());
        Console.WriteLine("请输入你的年薪");
        double  money = Convert.ToInt32(Console.ReadLine());
        double sume = 0;
        while (year <= 65)
        {sume+=money;
            money *= 1.05;
            year++;
        }
            Console.WriteLine("你退休前能赚到{0}元",sume);
        
        Console.ReadKey();

相关文章

网友评论

      本文标题:2018-11-08作业

      本文链接:https://www.haomeiwen.com/subject/ueiixqtx.html