bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】

原来强行转int可以避免四舍五入啊

#include<iostream>
#include<cstdio>
using namespace std;
int r,y;
double m;
int main()
{
    scanf("%d%lf%d",&r,&m,&y);
    double l=1.0+(double)r/100.0;
    for(int i=1;i<=y;i++)
        m*=l;
    printf("%d\n",(int)m);
    return 0;
}

原文地址:https://www.cnblogs.com/lokiii/p/9215679.html

时间: 2024-11-10 10:07:38

bzoj 1755: [Usaco2005 qua]Bank Interest【模拟】的相关文章

[BZOJ1755] [Usaco2005 qua] Bank Interest

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

BZOJ 1754: [Usaco2005 qua]Bull Math

Description Bulls are so much better at math than the cows. They can multiply huge integers together and get perfectly precise answers ... or so they say. Farmer John wonders if their answers are correct. Help him check the bulls' answers. Read in tw

bzoj 1754: [Usaco2005 qua]Bull Math【高精乘法】

高精乘法板子 然而WA了两次也是没救了 #include<iostream> #include<cstdio> #include<cstring> using namespace std; const int N=105; int la,lb,lc,a[N],b[N],c[N],tot; char ch[N]; int main() { scanf("%s",ch+1); la=strlen(ch+1); for(int i=1;i<=la;i

bzoj1754[Usaco2005 qua]Bull Math*

bzoj1754[Usaco2005 qua]Bull Math 题意: 求两个正整数的积,每个数≤40位. 题解: 为什么C++不能支持高精度呢…… 代码: 1 a=int(raw_input()) 2 b=int(raw_input()) 3 print a*b 20160831

1751: [Usaco2005 qua]Lake Counting

1751: [Usaco2005 qua]Lake Counting Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 190  Solved: 150[Submit][Status][Discuss] Description Due to recent rains, water has pooled in various places in Farmer John's field, which is represented by a rectangle

BZOJ1753: [Usaco2005 qua]Who&#39;s in the Middle

问n<=10000个点的中位数. 水题必有玄机!(然后浪费了半天在怎么O(n)求中位数并且最后放弃了) 1 #include<stdio.h> 2 #include<string.h> 3 #include<algorithm> 4 #include<cstdlib> 5 //#include<iostream> 6 using namespace std; 7 8 int n; 9 #define maxn 10011 10 int a[

【BZOJ】1754: [Usaco2005 qua]Bull Math

[算法]高精度乘法 #include<cstdio> #include<algorithm> #include<cstring> using namespace std; const int maxn=100; char s1[maxn],s2[maxn]; int a[maxn],b[maxn],c[maxn],lena,lenb,lenc; int main(){ scanf("%s%s",s1,s2); lena=strlen(s1);lenb

bzoj 1689: [Usaco2005 Open] Muddy roads 泥泞的路

1689: [Usaco2005 Open] Muddy roads 泥泞的路 Description Farmer John has a problem: the dirt road from his farm to town has suffered in the recent rainstorms and now contains (1 <= N <= 10,000) mud pools. Farmer John has a collection of wooden planks of

PAT-甲级-1017. Queueing at Bank【模拟】

1017. Queueing at Bank Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait in line behind the yellow line, until it is his/her tur