2018-10-07

#include

#include

using namespace std;

int main()

{double add(double sum);

double returnnumber,inputnumber=0;

returnnumber=add(inputnumber);

cout<<"answer is:"<

return 0;

}

double add(double sum)

{

double first=1,second=1;

double a,b,t;

while (t>=0.0001||t<=-0.0001)

  {sum=second+first;

    a=sum/second;

    b=second/first;

    t=a-b;

    first=second;

    second=sum;

  }

    return (a);

}

你可能感兴趣的:(2018-10-07)