bzoj1755 [Usaco2005 qua]Bank Interest
Description
Input
Output
Sample Input
INPUT DETAILS:
5% annual interest, 5000 money, 4 years
Sample Output
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的更多相关文章
- 1755: [Usaco2005 qua]Bank Interest
1755: [Usaco2005 qua]Bank Interest Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 187 Solved: 162[Su ...
- bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】
原来强行转int可以避免四舍五入啊 #include<iostream> #include<cstdio> using namespace std; int r,y; doub ...
- BZOJ1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 374 Solved: 227[Submit ...
- bzoj1751 [Usaco2005 qua]Lake Counting
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec Memory Limit: 64 MB Submit: 168 Solved: 130 [ ...
- Bank Interest
Bank Interest Time Limit : 2000/1000ms (Java/Other) Memory Limit : 131072/65536K (Java/Other) Tota ...
- 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: ...
- 1754: [Usaco2005 qua]Bull Math
1754: [Usaco2005 qua]Bull Math Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 398 Solved: 242[Submit ...
- 1751: [Usaco2005 qua]Lake Counting
1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 190 Solved: 150[Su ...
- bzoj3384[Usaco2004 Nov]Apple Catching 接苹果*&&bzoj1750[Usaco2005 qua]Apple Catching*
bzoj3384[Usaco2004 Nov]Apple Catching 接苹果 bzoj1750[Usaco2005 qua]Apple Catching 题意: 两棵树,每分钟会从其中一棵树上掉 ...
随机推荐
- cxSplitter.HotZone 怎么给分隔条增加值
请使用它的类名指定HotZoneClassName . cxSplitter1.ResizeUpdate := True; cxSplitter1.HotZoneClassName := 'TcxMe ...
- C# 实现MD5 Hash 计算
C#提供了一系列的加密库,可以让我们自由使用,这里我来介绍如何使用C#的加密库实现MD5 hash值的计算工作. 参考代码: private static String CalcMd5(String ...
- 如何让程序(如java Hello)只启动一次?
如何让程序(如java Hello)只启动一次? 摘自http://bbs.csdn.net/topics/50488704 总结一下,关于让Java程序只运行一个实例的问题,其实质是JVM之间通信的 ...
- C#使用WebKitBrowser.dll填坑记
.Net 自带的 Webbrowser 有着太多的平台限制.对于用户体验之上的今天,这无疑是一个噩梦, 然后就开始找 .Net下的WebKitBrowser.dll (后面提供下载) 从开源网站下到程 ...
- (转)iOS7界面设计规范(11) - UI基础 - 图标与图形
不知别人如何,我自己来讲,平时很习惯很有动力去做的一些事,譬如博客吧,一旦生活中出现一些让自己很难受的状况,就很容易受到影响:像是,你平时所习惯的生活状态都是基于某种东西的,一旦这种东西崩塌,会影响到 ...
- http接口测试浏览器插件
http接口测试浏览器插件: Chrome: https://chrome.google.com/webstore/detail/chrome-poster/cdjfedloinmbppobahmon ...
- Class的生命周期
之前的<JVM类载入机制-ClassLoader>和<初探JVM-ClassLoader源代码>,仅仅是讨论了Class的载入部分,如今来纵观一下整个Class的生命周期. C ...
- [Javascript] Advanced Reduce: Composing Functions with Reduce
Learn how to use array reduction to create functional pipelines by composing arrays of functions. co ...
- SQL数据库注入防范 ASP.NET Globle警告
在项目中的Global.asax页面代码中加下面的代码,就可以有效的防范简单的SQL注入. protected void Application_BeginRequest(Object sender, ...
- ASP.Net MVC与WebForm的区别