Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我觉得是精度问题吧,最后的结果连int64也放不下的

Posted by frkstyc at 2005-05-20 08:25:04
In Reply To:2084 请教一个简单题:关于母函数的,为什么会出错,觉得没错呀? Posted by:bjtu01281229 at 2005-05-20 03:25:48
> #include <iostream>
> #include <math.h>
> using namespace std;
> 
> int  main()
> {
>     double p,y;
>     double c1=(5-sqrt(double(5)))/10,c2=(5+sqrt(double(5)))/10,d1=(3+sqrt(double(5)))/2,d2=(3-sqrt(double(5)))/2;
>     cin>>y;
>     while(y!=-1)
>      { p=c1*pow(d1,y)+c2*pow(d2,y);
>        cout<<p<<endl;
>        cin>>y;
>       }
>     return 0;
> }

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator