# OpenJudge

1000ms

65536kB

50 10

8

#include<iostream>
using namespace std;
int main(){
int N,K;
cin>>N>>K;
float price=200;
float earn=N;
int year=1;
while(earn<price){
if(year>20){
cout<<"Impossible"<<endl;
break;
}
earn+=N;
price=price*(1.0+(float)K/100);
year++;
}
if(year<=20) cout<<year<<endl;
return 0;
}

5 5000 4

6077

6077.53125的整数部分为6077。

#include<iostream>
using namespace std;
int main(){
int r,m,y;
cin>>r>>m>>y;
double shouyi=m;
for(int i=1;i<=y;i++){
shouyi=shouyi*(1+r*0.01);
}
int k=(int)shouyi;
printf("%d",k);
return 0;
}

2008年北京奥运会，A国的运动员参与了n天的决赛项目(1≤n≤17)。现在要统计一下A国所获得的金、银、铜牌数目及总奖牌数。

3
1 0 3
3 1 0
0 3 0

4 4 3 11

#include<iostream>
using namespace std;
int main(){
int n,i,t,k,l,jinpai=0,yinpai=0,tongpai=0;
cin>>n;
for(i=1;i<=n;i++){
cin>>t>>k>>l;
jinpai=jinpai+t;
yinpai=yinpai+k;
tongpai=tongpai+l;
}
cout<<jinpai<<" "<<yinpai<<" "<<tongpai<<" "<<jinpai+yinpai+tongpai<<endl;
return 0;
}

6
3 0 8 7 5 9

9

#include<iostream>
using namespace std;
int main(){
int n,i;
cin>>n;
int a[1005]={0};
int max=0,min=1000;
for(i=1;i<=n;i++){
cin>>a[i];
if(max<a[i]) max=a[i];
if(min>a[i]) min=a[i];
}
cout<<max-min<<endl;
return 0;
}