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. 根据ClassName获取元素节点

    功能描述: 通过ClassName获取元素节点,并解决兼容性问题 实现效果: 编码思路: 利用getElementsByTagName选出所有元素,再根据ClassName条件进行筛选 代码示例:

  2. channel bonding

    一.什么是bondingLinux bonding驱动提供了一个把多个网络接口设备捆绑为单个的网络接口设置来使用,用于网络负载均衡及网络冗余二.bonding应用方向1.网络负载均衡对于bonding ...

  3. ARM裸板调试思路总结、笔记

    1. 点灯 2. 串口打印 3. JTAG调试器3.1 命令行调试 3.2 源码级别的调试前提a. 程序必须已经重定位好,位于它的链接地址a.1 如果程序的链接地址是SDRAM, 使用openocd初 ...

  4. Java线程池主线程等待子线程执行完成

    今天讨论一个入门级的话题, 不然没东西更新对不起空间和域名~~ 工作总往往会遇到异步去执行某段逻辑, 然后先处理其他事情, 处理完后再把那段逻辑的处理结果进行汇总的产景, 这时候就需要使用线程了. 一 ...

  5. Black Jack

    Black Jack 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5602 记忆化搜索 用dp[0][i][j]记录当player为i,banker为 ...

  6. 实验吧Web-FALSE

    笔记: PHP函数isset(): 检测变量是否设置 只能用于变量,传递任何其它参数都将造成解析错误.若想检测常量是否已设置,可使用 defined() 函数 格式:  isset ( mixed v ...

  7. 利用ckeditor 富文本编辑插件静态化网页

    // step5: 生成静态化html FileOutputStream fos = null;            PrintStream printStream = null;          ...

  8. Linux随笔(安装ftp,安装jdk,安装 tomcat,安装redis,安装MySQL)

    su: authentication failure 解决办法:sudo passwd root  更改密码即可 确认虚拟机用到的联网方式是桥接模式,不然Windows是ping不通Linux的,确保 ...

  9. bzoj2052: Pku1777 Vivian

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=2052 2052: Pku1777 Vivian Time Limit: 10 Sec  M ...

  10. openwrt 中procd

    https://wiki.openwrt.org/doc/techref/procd Procd:Openwrt的进程管理守护进程(process management daemon),它与初始化脚本 ...