#include <stdio.h>

int main()
{
    double table[100001];
    double t=2.0;
    table[1]=0.5;
    
    for(int i=2;i<100001;i++)
    {
        t+=2;
        table[i]=table[i-1]+1.0/t;
    }

    printf("# Cards  Overhang\n");
    int n;
    while(scanf("%d",&n)!=EOF)
    {
        printf("%5d%10.3lf\n",n,table[n]); 
    }

    return 0;
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-05
  • 2022-01-11
  • 2022-01-13
猜你喜欢
  • 2022-02-01
  • 2021-09-09
  • 2021-08-25
  • 2021-12-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案