胡漠杨 @ 2020-03-14 21:06:04
#include<stdio.h>
float sum(float (1/n));
int main()
{
int n,k;
scanf ("%d",&k);
for (n=1;;n++)
{
if (k<sum(1/n))
{
break;
}
printf ("%d",n);
}
return 0;
}
float sum(float (1/n))
{
int n;
if (n==1)
{
return 1;
}
else
{
return sum(1/(n-1))+(1/n);
}
}
by Marser @ 2020-03-14 21:36:08
@胡漠杨 没事没事