//////////////////////////////////////////////////////////////////
//Deck
//叠多少张牌可超桌面多少
#include<iostream.h>
#include<iomanip.h>
//using namespace std;

 


int main()
{
    int n,i;
    float out;
    cout<<"# Cards  Overhang"<<endl;
    while((cin>>n)!=NULL)
    {
        out=0.00;
        for(i=1;i<=n;i++)
            out+=float(1)/(2*i);
        cout<<setw(5)<<setiosflags(ios::right)<<n
            <<setw(10)<<setiosflags(ios::right)
            <<setiosflags(ios::fixed)<<setprecision(3)
            <<out<<endl;
    }
    return 0;
}

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-16
  • 2021-04-24
  • 2021-08-07
  • 2021-08-21
  • 2021-09-03
  • 2022-01-06
猜你喜欢
  • 2022-02-27
  • 2021-06-08
  • 2021-10-04
  • 2021-07-12
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案