| ||||||||||
| 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 | |||||||||
Re:请过的大侠,帮一下。。In Reply To:请过的大侠,帮一下。。 Posted by:jjh at 2005-09-16 19:58:23 1.精度可能有问题
2.多组数据
> 怎么就出错了呢 ??
> #include<stdio.h>
> void main()
> {
> float a[3002],c[3002],equa;
> int num,i,x[3002];
> scanf("%d",&num);
> scanf("%f%f",&a[0],&equa);
> for(i=1;i<=num;i++)
> scanf("%f",&c[i]);
> a[1]=0;
> x[1]=1;
> x[0]=0;
> for(i=2;i<=num+1;i++)
> {
> a[i]=2*a[i-1]+2*c[i-1]-a[i-2];
> x[i]=2*x[i-1]-x[i-2];
> }
> printf("%.2f\n",(equa-a[num+1])/x[num+1]);
> }
>
>
>
>
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator