#include<iostream>#include<cstdio>#include<math.h>usingnamespace std;intmain(){int n;double x, s;while(~scanf("%lf%d",&x,&n)){for(s =0.0; n--; x =sqrt(x))
s += x;printf("%.2lf\n", s);}return0;}
Python3
import sys
n =int(sys.stdin.readline())
nums =list(map(int, sys.stdin.readline().split()))print(n,type(n))print(nums,type(nums[0]))
import sys
import math
i =0# for i, line in enumerate(sys.stdin):# 已知数量时用i来breakfor line in sys.stdin:# 去掉首尾的空白字符或换行符# 防止最后对空行处理
line = line.strip()ifnot line:break
s =0.0while n >0:
s += x
x = math.sqrt(x)
n -=1# 输出结果,保留两位小数print(f"{s:.2f}")