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. cxSplitter.HotZone 怎么给分隔条增加值

    请使用它的类名指定HotZoneClassName . cxSplitter1.ResizeUpdate := True; cxSplitter1.HotZoneClassName := 'TcxMe ...

  2. C# 实现MD5 Hash 计算

    C#提供了一系列的加密库,可以让我们自由使用,这里我来介绍如何使用C#的加密库实现MD5 hash值的计算工作. 参考代码: private static String CalcMd5(String ...

  3. 如何让程序(如java Hello)只启动一次?

    如何让程序(如java Hello)只启动一次? 摘自http://bbs.csdn.net/topics/50488704 总结一下,关于让Java程序只运行一个实例的问题,其实质是JVM之间通信的 ...

  4. C#使用WebKitBrowser.dll填坑记

    .Net 自带的 Webbrowser 有着太多的平台限制.对于用户体验之上的今天,这无疑是一个噩梦, 然后就开始找 .Net下的WebKitBrowser.dll (后面提供下载) 从开源网站下到程 ...

  5. (转)iOS7界面设计规范(11) - UI基础 - 图标与图形

    不知别人如何,我自己来讲,平时很习惯很有动力去做的一些事,譬如博客吧,一旦生活中出现一些让自己很难受的状况,就很容易受到影响:像是,你平时所习惯的生活状态都是基于某种东西的,一旦这种东西崩塌,会影响到 ...

  6. http接口测试浏览器插件

    http接口测试浏览器插件: Chrome: https://chrome.google.com/webstore/detail/chrome-poster/cdjfedloinmbppobahmon ...

  7. Class的生命周期

    之前的<JVM类载入机制-ClassLoader>和<初探JVM-ClassLoader源代码>,仅仅是讨论了Class的载入部分,如今来纵观一下整个Class的生命周期. C ...

  8. [Javascript] Advanced Reduce: Composing Functions with Reduce

    Learn how to use array reduction to create functional pipelines by composing arrays of functions. co ...

  9. SQL数据库注入防范 ASP.NET Globle警告

    在项目中的Global.asax页面代码中加下面的代码,就可以有效的防范简单的SQL注入. protected void Application_BeginRequest(Object sender, ...

  10. ASP.Net MVC与WebForm的区别