题解 | #数列的和#
数列的和
https://www.nowcoder.com/practice/fe19f8a78a5148018f4be53ae9b5e11e
#include <stdio.h> #include<math.h> int main() { int m = 0; int n = 0; while (~scanf("%d %d", &n, &m)) { double num = (double)n; double sum = (double)n; for (int i = 1; i < m; i++) { sum += sqrt((double)num); num = sqrt(num); } printf("%.2lf\n", sum); } return 0; }