题面
Write a RECURSIVE function to compute the following formula:
/***************************************************************/
/* */
/* DON'T MODIFY main function ANYWAY! */
/* */
/***************************************************************/
#include <stdio.h>
double sum(int n)
{
// TODO: your function definition
}
int main()
{
int n;
scanf("%d",&n);
printf("%f\n",sum(n));
return 0;
}
样例
输入
29358
输出
0.693130
输入
1
输出
1.000000
输入
3
输出
0.833333