POJ 2390 Bank Interest(水~)

来源:互联网 发布:中国法律 知乎 编辑:程序博客网 时间:2024/06/08 11:15

Description
给定利率,本金和年数,求最后的总金额
Input
三个整数a,b,c分别表示利率,本金和年数
Output
输出存c年后的总金额
Sample Input
5 5000 4
Sample Output
6077
Solution
纯净水…
Code

#include<stdio.h>#include<math.h>int main(){    int a,c,i;    double b;    scanf("%d%lf%d",&a,&b,&c);    b*=pow((1+a/100.0),c);    printf("%d\n",(int)b);    return 0;}
0 0
原创粉丝点击