Description

Farmer John made a profit last year! He would like to invest it well but wonders how much money he will make. He knows the interest rate R (an integer between 0 and 20) that is compounded annually at his bank. He has an integer amount of money M in the range 100..1,000,000. He knows how many years Y (range: 0..400) he intends to invest the money in the bank. Help him learn how much money he will have in the future by compounding the interest for each year he saves. Print an integer answer without rounding. Answers for the test data are guaranteed to fit into a signed 32 bit integer. 看了样例输入输出就知道怎么回事了..........

Input

* Line 1: Three space-separated integers: R, M, and Y

Output

* Line 1: A single integer that is the number of dollars FJ will have after Y years.

Sample Input

5 5000 4

INPUT DETAILS:

5% annual interest, 5000 money, 4 years

Sample Output

6077

OUTPUT DETAILS:

Year 1: 1.05 * 5000 = 5250
Year 2: 1.05 * 5250 = 5512.5
Year 3: 1.05 * 5512.50 = 5788.125
Year 4: 1.05 * 5788.125 = 6077.53125
The integer part of 6077.53125 is 6077.

一大波水题正在接近……

真是没什么好说的,求m*(1+r/100)^y

我有特殊的缩代码技巧

#include<cstdio>
double r,m;
int y;
int main()
{
scanf("%lf%lf%d",&r,&m,&y);
while (y--)m*=(1+r/100);
printf("%d",(int)m);
}

bzoj1755 [Usaco2005 qua]Bank Interest的更多相关文章

  1. 1755: [Usaco2005 qua]Bank Interest

    1755: [Usaco2005 qua]Bank Interest Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 187  Solved: 162[Su ...

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

    原来强行转int可以避免四舍五入啊 #include<iostream> #include<cstdio> using namespace std; int r,y; doub ...

  3. BZOJ1754: [Usaco2005 qua]Bull Math

    1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 374  Solved: 227[Submit ...

  4. bzoj1751 [Usaco2005 qua]Lake Counting

    1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 168  Solved: 130 [ ...

  5. Bank Interest

    Bank Interest Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other) Tota ...

  6. 1753: [Usaco2005 qua]Who's in the Middle

    1753: [Usaco2005 qua]Who's in the Middle Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 290  Solved:  ...

  7. 1754: [Usaco2005 qua]Bull Math

    1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 398  Solved: 242[Submit ...

  8. 1751: [Usaco2005 qua]Lake Counting

    1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 190  Solved: 150[Su ...

  9. bzoj3384[Usaco2004 Nov]Apple Catching 接苹果*&&bzoj1750[Usaco2005 qua]Apple Catching*

    bzoj3384[Usaco2004 Nov]Apple Catching 接苹果 bzoj1750[Usaco2005 qua]Apple Catching 题意: 两棵树,每分钟会从其中一棵树上掉 ...

随机推荐

  1. bzoj4033

    http://www.lydsy.com/JudgeOnline/problem.php?id=4033 树形DP. 我们发现,每条边都是一条桥,若我们知道这条边其中一侧有多少个黑点,我们就可以知道这 ...

  2. java进阶计划

    鉴于自己在java 的学习过程中,像是无头苍蝇一样,东扎一把,西戳一下,没有一个明确的方向,也没有一个比较明确的方面,所以有了这个大致的计划. 计划的目标: 1. java本身的目标 对线程(thre ...

  3. cf443B Kolya and Tandem Repeat

    B. Kolya and Tandem Repeat time limit per test 2 seconds memory limit per test 256 megabytes input s ...

  4. 【转】WCF、WebAPI、WCFREST、WebService之间的区别

    在.net平台下,有大量的技术让你创建一个HTTP服务,像Web Service,WCF,现在又出了Web API.在.net平台下,你有很多的选择来构建一个HTTP Services.我分享一下我对 ...

  5. FragmentPagerAdapter与FragmentStatePagerAdapter差异

    平常使用的FragmentPagerAdapter和FragmentStatePagerAdapter来自android.support.v4.app包用来构建ViewPager. FragmentP ...

  6. open(),close() 打开/关闭文件

    Open open()是一个系统调用函数,用来打开或创建一个文件,通过不同的oflag选项实现不同功能. 使用时open()函数需要包含的头文件:<sys/types.h>,<sys ...

  7. DEV SIT UAT

    DEV环境:DEV顾名思义就是develop,即代码开发的环境.SIT环境:System Integration Test系统集成测试,开发人员自己测试流程是否走通.UAT环境:User Accept ...

  8. css重点

    1.CSS的盒子模型? (1)两种, IE 盒子模型.标准 W3C 盒子模型:IE 的content部分包含了 border 和 pading; (2)盒模型: 内容(content).填充(padd ...

  9. asp Eval()函数的一些使用总结

    一.函数的原型: Eval(string s); s可以是变量,表达式,语句: 二.使用: 1.s为变量时,返回该变量的值,如:string s = "sss";Eval(s);/ ...

  10. 注意:"AspNetPager”的控件“AspNetPager1”必须放在具有 runat=server 的窗体标记内

    应加: <form id="form1" runat="server"> </form> 否则一开始什么也不显示,页面控件看不见,加上a ...