| ||||||||||
| Online Judge | Problem Set | Authors | Online Contests | User | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest | |||||||||
2084 请教一个简单题:关于母函数的,为什么会出错,觉得没错呀?#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator