| ||||||||||
| 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 | |||||||||
请过的大侠,帮一下。。怎么就出错了呢 ??
#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