1 #include<stdio.h>
 2 int n;
 3 double rev(int c)
 4 {
 5     return c<=n?(((c&1)?1.0:-1.0)/c+rev(c+1)):0 ;
 6 }
 7 int main()
 8 {
 9     int t;
10     scanf("%d",&t);
11     while(t--&&scanf("%d",&n))
12     printf("%.2lf\n",rev(1));
13     return 0;
14 }

相关文章:

  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-02-28
  • 2021-09-09
  • 2021-10-23
  • 2022-12-23
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-06
  • 2021-06-12
  • 2021-11-16
相关资源
相似解决方案