Bank Interest

Time Limit : 2000/1000ms (Java/Other)   Memory Limit : 131072/65536K (Java/Other)
Total Submission(s) : 45   Accepted Submission(s) : 18
Problem 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
 
Sample Output
6077
 
Source
PKU

 #include <stdio.h>
#include <stdlib.h> int main()
{
double SUM,r,R,M,Y,i;
while(scanf("%lf%lf%lf",&R,&M,&Y)!=EOF)
{
SUM=M;
for(i=,r=;i<Y;i++)
{
r=SUM*(0.01*R);
SUM=SUM+r;
}
printf("%ld\n",(long)SUM);
}
return ;
}

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. bzoj1755 [Usaco2005 qua]Bank Interest

    Description Farmer John made a profit last year! He would like to invest it well but wonders how muc ...

  3. poj 2390 Bank Interest(计算本利和)

    一.Description Farmer John made a profit last year! He would like to invest it well but wonders how m ...

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

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

  5. POJ解题经验交流

    感谢范意凯.陈申奥.庞可.杭业晟.王飞飏.周俊豪.沈逸轩等同学的收集整理.   题号:1003 Hangover求1/2+1/3+...1/n的和,问需多少项的和能超过给定的值 类似于Zerojudg ...

  6. OpenJudge解题经验交流

    1.1编程基础之输入输出01:Hello, World! 02:输出第二个整数PS:a,b需用longint类型接收 03:对齐输出 04:输出保留3位小数的浮点数 05:输出保留12位小数的浮点数 ...

  7. 【Python】python-一个class继承的小case

    #-*- coding:utf-8 -*-#定义银行类,包含属性:用户名,账户,余额:包含方法有:查询余额,存钱,取钱class BankAccount(): def __init__(self,na ...

  8. bzoj usaco 金组水题题解(2)

    续.....TAT这回不到50题编辑器就崩了.. 这里塞40道吧= = bzoj 1585: [Usaco2009 Mar]Earthquake Damage 2 地震伤害 比较经典的最小割?..然而 ...

  9. BZOJ-USACO被虐记

    bzoj上的usaco题目还是很好的(我被虐的很惨. 有必要总结整理一下. 1592: [Usaco2008 Feb]Making the Grade 路面修整 一开始没有想到离散化.然后离散化之后就 ...

随机推荐

  1. Zend Studio 无法打开的解决办法

    今天郁闷的...正在写代码,突然 computer 嗝屁了,断电后自动重启了一次,开机后就悲剧了,Zend Studio 9 无法打开了,每次运行只弹窗个 请查看项目错误日志的提示 然后就没反应了.. ...

  2. git切换分支

    今天同事问我她的报错了,我看了一下,是分支没有指向远程仓库对应的分支;报错如下; $ git pull There is no tracking information for the current ...

  3. 转:Cocoa、Foundation、UIKit、Objective-c、XCode、Interface Builder的概念

    Cocoa 是在Mac OS X系统上原生的一个编译环境.他包含两个框架,其实就是一系列的类库,Foundation和AppKit. 在你的iPhone等掌上设备上,使用的则是他的一个子类 - Coc ...

  4. ASP.NET Page执行顺序

    using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Secu ...

  5. css布局理解

    1.盒模型(页面的所有元素都看成一个类似于礼品盒的盒子:包括块级元素和行内元素(也叫内联元素)):http://www.cnblogs.com/cchyao/archive/2010/07/12/17 ...

  6. 《JS权威指南学习总结--8.8.4 记忆函数》

    内容要点:   可以将上次的计算结果缓存起来.在函数式编程当中,这中缓存技巧叫做 "记忆". 需要注意的是,记忆只是一种编程技巧,本质上是牺牲算法的空间复杂度以换取更优的时间复杂度 ...

  7. Node.js:url

    在node运行环境中输入url: > url url { parse: [Function: urlParse], resolve: [Function: urlResolve], resolv ...

  8. 关于Unity项目中创建项目遇到的一些问题

    1.Unity调用Android的方法默认不是在UI线程执行,所以在Android上写一些页面的重绘的方法,让Unity去调用时,注意要在Android中添加对应的runOnUiThread才可以: ...

  9. spoj1811:Longest Common Substrin

    题目链接:http://begin.lydsy.com/JudgeOnline/problem.php?id=2796 把一个字符串做出后缀自动机,另一个字符串与之匹配. #include<cs ...

  10. Java Object 对象拷贝答疑

    Java Object 对象拷贝答疑 @author ixenos 摘要:在对象的clone过程需要注意的几点.关于关键字this.super 关于clone[对象拷贝] 在实际编程过程,有时候我们会 ...