testing-repository/cpp/algorithms/problem10.cpp

19 lines
322 B
C++
Raw Normal View History

2021-12-05 18:39:33 +08:00
//http://acm.hdu.edu.cn/showproblem.php?pid=2009
#include <cstdio>
#include <cmath>
int main(){
int m;
double n;
while(scanf("%lf%d",&n,&m)!=EOF){
double sum = 0;
for(int i=0;i<m;i++){
sum += n;
n=sqrt(n);
}
printf("%.2f\n",sum);
}
return 0;
}