hdoj 2009

来源:互联网 发布:化学软件初中 编辑:程序博客网 时间:2024/05/16 05:52

hdoj 2009

AC代码(C语言)

#include<stdio.h>  #include<math.h>  int main() {      double n, m;      while(scanf("%lf%lf", &n, &m)!=EOF) {          double ans = n;          double tmp = n;          for(int i = 1; i <= m-1; i++) {              tmp = sqrt(tmp);              ans += tmp;          }          printf("%.2lf\n", ans);      }      return 0;   }