题目链接:点击打开链接
代码实现:
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
using namespace std;
int main()
{
long long n,h,i;
double a[1005];
while(scanf("%d%d",&n,&h)!=EOF)
{
for(i=1;i<n;i++)
{
a[i]=sqrt(i/(n*1.0))*h;
}
printf("%.12llf",a[1]);
for(i=2;i<n;i++)
{
printf(" %.12llf",a[i]);
}
printf("\n");
}
return 0;
}