码迷,mamicode.com
首页 > 其他好文 > 详细

bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】

时间:2018-06-22 23:58:23      阅读:370      评论:0      收藏:0      [点我收藏+]

标签:mes   TE   原来   rest   name   res   include   std   turn   

原来强行转int可以避免四舍五入啊

#include<iostream>
#include<cstdio>
using namespace std;
int r,y;
double m;
int main()
{
    scanf("%d%lf%d",&r,&m,&y);
    double l=1.0+(double)r/100.0;
    for(int i=1;i<=y;i++)
        m*=l;
    printf("%d\n",(int)m);
    return 0;
}

bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】

标签:mes   TE   原来   rest   name   res   include   std   turn   

原文地址:https://www.cnblogs.com/lokiii/p/9215679.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!