题解 | #牛牛学数列2#
牛牛学数列2
http://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
int main()
{
int a = 0;
double c = 0;
scanf("%d", &a);
for (int b = 1; b <= a; b++)
{
c = 1.0 / b + c;
}
printf("%.6lf", c);
return 0;
}
牛牛学数列2
http://www.nowcoder.com/practice/fc72951f52984f3abd286d82eeffacba
int main()
{
int a = 0;
double c = 0;
scanf("%d", &a);
for (int b = 1; b <= a; b++)
{
c = 1.0 / b + c;
}
printf("%.6lf", c);
return 0;
}
相关推荐