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 |
为什么RTE呢?#include<iostream.h> #include<iomanip.h> int n; double *c; double x,y; double a(int i) { if(i==0) return x; if(i==n+1) return y; return (a(i-1)+a(i+1))/2-c[i-1]; } void main() { cin>>n; if(n!=0) c=new double [n]; cin>>x>>y; for(int i=0;i<n;i++) cin>>c[i]; cout<<setiosflags(ios::fixed); if(n==0) { cout<<setprecision(2)<<y<<endl; return; } cout<<setprecision(2)<<a(1)<<endl; delete [] c; } Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator