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. Scope Directive

    ---------------------------Scope-------------------------------- https://docs.angularjs.org/guide/sc ...

  2. js的变量声明以及变量提升

    js的变量声明: js正常的变量声明就不多讲了,形如var a=1;这样的变量声明在实际开发中最常用. var a=1,b=2;这种以逗号分隔开的一次声明多个变量,其实相当于var a=1; var ...

  3. jQuery(6)——jQuery对表单、表格的操作及更多应用

    jQuery对表单.表格的操作及更多应用 [表单应用] 一个表单有表单标签.表单域及表单按钮三个基本部分. 单行文本框应用:获取和失去焦点改变样式. 也可以用CSS中的伪类选择符来实现,但是IE6并不 ...

  4. 跨域资源共享(Cross-Origin Resource Sharing)

    目前中文方面的资料还比较少,能搜索到的那仅有的几篇相关介绍,也几乎是雷同的,其中C#方面的更是少之又少. XMLHttpRequest接口是Ajax的根本,而Ajax考虑到安全性的问题,是禁止跨域访问 ...

  5. cocos2d-lua ARPG手机游戏《烈焰遮天》(客户端+服务端+数据库)发布说明

    服务器发布流程及其规范1,环境准备        a, mvn命令行:从\\10.21.210.161\share\tools\apache-maven-3.1.1-bin.tar.gz取出安装包,  ...

  6. 云锁Linux服务器安全软件安装及防护webshell、CC、XSS跨站攻击设置

    无论我们在使用电脑,还是使用VPS/服务器的时候,最为担心的就是服务器是否有安全问题,尤其是网站服务器再遭受攻击的时候如何得到防护.对于大 部分站长用户来说,我们可能只会使用基础的环境,如果真遇到问题 ...

  7. 第八十五节,css布局补充一

    css布局补充一 图片边框问题 注意css布局时img图片标签默认有的浏览器有边框,所以大多时候需要去除图片的边框 CSS各种居中方法 水平居中的text-align:center 和 margin: ...

  8. 一行一行分析JQ源码学习笔记-01

    jQuery (function(window,undefined){ }) undefined 防止外部参数中 var  undefined =10:以此来改变内部 undefined 不太建议用严 ...

  9. Java JVM 多态(动态绑定)

    Java JVM 多态(动态绑定) @author ixenos 摘要:绑定.动态绑定实现多态.多态的缺陷.纯继承与扩展接口.向下转型与RTTI 绑定 将一个方法的调用和一个方法的主体关联起来,称作( ...

  10. OpenCV常用函数分析

    1. 聚类:将拥有最相似属性的数据归为一类. K-means聚类: python调用格式:compacness, labels, centers = cv2.kmeans(data, K, crite ...