杭电OJ2009

#include <iostream>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	int n;
	double m,s;
	while (cin >> n>>m)
	{
		s = 0;
		double j=n;
		for (int i = 1; i <= m; i++)
		{
			s = s + j;
			j = sqrt(j);
		}
		cout << setprecision(2) << fixed << s << endl;
	}
}

猜你喜欢

转载自blog.csdn.net/weixin_42265486/article/details/83592634