题干:

Suppose you open a savings account with a certain initial balance. You will not make any withdrawals or further deposits for a number of years. The bank will compound your balance (add the annual interest) once a year, on the anniversary of the opening of the account. Your goal is to achieve a certain target amount in your savings account. In how may years will the target amount be achieved?

Input

The input file will contain data for one or more test cases, one test case per line. Each line will contain three numbers: the initial balance, the annual interest rate (as a percentage of the balance), and the target amount, separated by blank spaces. These will be positive numbers; they may or may not contain a decimal point. The target amount will be greater than the initial balance. The input is terminated by end-of-file

Output

For each line of input, your program will produce exactly one line of output: This line will contain one positive integer value: the number of years required to achieve the target amount.

Sample Input

200.00 6.5 300
500 4 1000.00

Sample Output

7
18

题目大意:

给本金和银行利率和最后取款  求多少年后可达到。。。

解题报告:

签到的大水题,不解释了。

AC代码:

#include<bits/stdc++.h>
using namespace std;
double down,rate,up;
int main()
{while(cin>>down>>rate>>up) {int ans = 0;rate /= 100;while(down < up) {down = (1+rate) * down;ans++;}cout << ans << endl;        }return 0 ;
}

【HDU - 2398 】Savings Account (水题模拟)相关推荐

  1. 【HDU - 1870】愚人节的礼物(水题模拟 思想类似于栈?)

    题干: 四月一日快到了,Vayko想了个愚人的好办法--送礼物.嘿嘿,不要想的太好,这礼物可没那么简单,Vayko为了愚人,准备了一堆盒子,其中有一个盒子里面装了礼物.盒子里面可以再放零个或者多个盒子 ...

  2. 【HDU - 1702 】ACboy needs your help again! (栈和队列,水题模拟)

    题干: ACboy was kidnapped!!  he miss his mother very much and is very scare now.You can't image how da ...

  3. HDU1555 How many days?【水题+模拟】

    How many days? Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) T ...

  4. HDU 6168 Numbers 思维 水题

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=6168 题目描述: 定义数组b是由数组a每两项的和组成的,现在将数组A, B混在一起给你, 筛出数组A ...

  5. CDOJ 763 树上的鸟儿(水题/模拟题)

    树上的鸟儿 Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 65535/65535KB (Java/Others) 作为电子科大的一员, ...

  6. *【CodeForces - 574A】Bear and Elections (优先队列,水题模拟)

    题干: Limak is a grizzly bear who desires power and adoration. He wants to win in upcoming elections a ...

  7. HDU 4393 Throw nails [水题]

    题解写了N多方法,我用的是最水的那种.. 起始区间只有(0 <= Fi <= 500),500秒之后排名必然不会变化了..所以,暴力500秒,然后排个序就行了. 1 #include &l ...

  8. 【CodeForces - 334B】Eight Point Sets(水题模拟,有坑)

    题干: Gerald is very particular to eight point sets. He thinks that any decent eight point set must co ...

  9. HDU - 2091 空心三角形 水题,但是有点坑...

    空心三角形 Time Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Subm ...

最新文章

  1. 用jQuery实现文件的上传,后台为spring+mybatis
  2. powershell真香
  3. github上手实践教程
  4. 为了OFFER,继续深入学习树和二叉树
  5. 一键发布部署vs插件[AntDeploy]开源了
  6. tl wn322g linux驱动下载,怎样才能装好tl_wn322G+V2.0版USB无线网卡的Linux驱动
  7. java向另一activity输入_Activity经典实例一:两个Activity传递数据和对象
  8. 【7】idea集成docker部署项目
  9. android obd编程,Android蓝牙连接汽车OBD设备
  10. SPFA和FLOYD算法如何打印路径
  11. Jquery的parent和parents(找到某一特定的祖先元素)
  12. 最长公共子序列问题解析
  13. linux 系统调试工具,Linux 系统调试...
  14. 【Buzz】简介及第一个案例
  15. 亚太区最美面孔杨超越登榜,网友:不喜欢她
  16. 《Java编程培训教程》
  17. 哔哩哔哩自动播放视频
  18. 浅谈eform自定义表单工具和协同办公系统
  19. NVIDIA Jetson Nano主机的autoware的学习与demo运行-第1章-操作环境的搭建
  20. 数据结构 Huffman树(霍夫曼树、哈夫曼树)

热门文章

  1. [Leetcode][第459题][JAVA][重复的字符串][子串][匹配]
  2. 【数据结构与算法】排序优化
  3. [剑指offer][JAVA]面试题第[30]题[包含min函数的栈][双栈辅助栈][单栈]
  4. python打开csv文件、计算总成绩_实现读取csv文件,文件里面是有限个百分数成绩(99.6、76.8等等...
  5. springtboot 引用子工程的文件_xmake从入门到精通11:如何组织构建大型工程
  6. webview 防止js注入_天台县js聚合物水泥防水涂料的作用
  7. java multimap 序列化_C++ JSON库的使用
  8. 给与用户建立dblink的权限_网络安全 之 NTFS安全权限
  9. OpenGL版本与OpenGL扩展机制
  10. uboot 的i2c_read