我觉得以后只能有了十分清晰的头脑才能够着手写带代码,,要不然写出来的代码自己改都不知道怎么改正.
#include <stdio.h> #include <string.h> #include <stdlib.h> #include <math.h> #include <iostream> #include <algorithm> using namespace std; int main() { int sta; int N; while(scanf("%d%d",&sta,&N)!=EOF) { double sum=sta; double flag=sta; N--; while(N--) { flag=sqrt(flag); sum+=flag; } printf("%.2lf\n",sum); } return 0; }