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. de4dot 脱壳工具

    开源免费的一款工具 官方地址http://www.de4dot.com/ 很NB的工具,能脱大部分的壳 如下 Babel.NET CodeFort CodeVeil CodeWall CryptoOb ...

  2. express学习点滴- 永远不要忘记异步

    直接上两段代码,因为nodejs基于异步和事件回调的解决方式,涉及到异步的时候,问题往往藏得很深,以下这个简单的问题困扰了很久.之前怀疑是各种问题,到处改.直到最后一步一步跟代码,跟操作数据库部分豁然 ...

  3. 【定位:PDF文件定位关键字所在坐标和页码】

    iText简介: iText是著名的开放源码的站点sourceforge一个项目,是用于生成PDF文档的一个java类库.通过iText不仅可以生成PDF或rtf的文档,而且可以将XML.Html文件 ...

  4. HTML <base> 标签的 href 属性

    为页面上所有相对 URL 规定基准 URL: <head> <base href="http://www.w3school.com.cn/i/" /> &l ...

  5. html5存储相关 coookie localstorage session storage

    html5存储 coookie  localstorage   session storage

  6. 字符串匹配—KMP 扩展KMP Manacher

    kuangbin字符串专题传送门--http://acm.hust.edu.cn/vjudge/contest/view.action?cid=70325#overview 算法模板: KMP: ; ...

  7. 四、WCF的配置文件

    注:本文为学习摘抄,原文地址:http://www.cnblogs.com/iamlilinfeng/archive/2012/10/02/2710224.html 一.概述 配置也是WCF编程中的主 ...

  8. 转 gl_VertexID的含义

    #version //layout(location = 0) in vec4 VERTEX; uniform mat4 MODEL_MATRIX; uniform mat4 VIEW_MATRIX; ...

  9. vs2015打开cshtml文件失败的解决方法

    最近不知道为什么,用vs2015打开cshtml识图文件的时候会报错.也不知道是什么原因,google之后得到解决方法如下: Close VS Delete the content of %Local ...

  10. LeetCode OJ 84. Largest Rectangle in Histogram

    Given n non-negative integers representing the histogram's bar height where the width of each bar is ...