整存整取定期存款利息C语言编程,c语言问题,与“银行整存整取存款不同期限的月息利率”有关,高手进...

满意答案

02ae427d08e371d7e90d5b995e828d6d.png

zgzmusic

2013.06.09

02ae427d08e371d7e90d5b995e828d6d.png

采纳率:57%    等级:13

已帮助:21490人

我恰巧写了个类似的程序,发上来给你参考下吧。

这么简单的程序还是自己写吧,偷懒无益。1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#include  #define OneYear     0.0063#define TwoYear     0.0066#define ThreeYear   0.0069#define FiveYear    0.0075#define EightYear   0.0084 double GetMaxMoney(const double corpus, const int year){    int spareYear = year;    double money = corpus;    double accrual;    while (spareYear > 0) {        if (spareYear / 8 > 0) {            spareYear -= 8;            accrual = money*EightYear*12*8;            money += accrual;            continue;        }        if (spareYear / 5 > 0) {            spareYear -= 5;            accrual = money*FiveYear*12*5;            money += accrual;            continue;        }        if (spareYear / 3 > 0) {            spareYear -= 3;            accrual = money*ThreeYear*12*3;            money += accrual;            continue;        }        if (spareYear / 2 > 0) {            spareYear -= 2;            accrual = money*TwoYear*12*3;            money += accrual;            continue;        }        if (spareYear / 1 > 0) {            spareYear -= 1;            accrual = money*OneYear*12*1;            money += accrual;            continue;        }       }    return money;} int main(void){       double corpus = 2000;    int year = 20;    double money = GetMaxMoney(corpus, year);    printf("%.02f\n", money);    getchar();}

00分享举报

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值