原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2009
分析:开根号后相加就好。
我的代码:
#include<stdio.h>
#include<math.h>
int main()
{
double n;
int m;
while(scanf("%lf%d",&n,&m)!=EOF)
{
double ans=0.0;
for(int i=0;i<m;i++)
{
ans+=n;
n=sqrt(n);
}
printf("%.2lf\n",ans);
}
return 0;
}
总结:总算有一道秒过的题→_→