zoukankan      html  css  js  c++  java
  • HDU 1056

    递推

     1 #include <iostream>
     2 using namespace std;
     3 double f[10000];
     4 double c;
     5 int main()
     6 {    
     7     f[0]=0;
     8     for(int i=1;i<=10000;i++) f[i]=1.0/(i+1)+f[i-1];
     9     while(cin>>c,c!=0)
    10     {
    11         int m=1;
    12          while(f[m]<c) m++;
    13          cout<<m<<" card(s)
    ";
    14     }
    15 } 
    我自倾杯,君且随意
  • 相关阅读:
    编程心得5
    编程心得2
    心得2
    心得1
    7-11
    7-13
    7-9
    7-8
    7-12
    7-14
  • 原文地址:https://www.cnblogs.com/nicetomeetu/p/5469344.html
Copyright © 2011-2022 走看看