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

请过的大侠,帮一下。。

Posted by jjh at 2005-09-16 19:58:23 on Problem 2601
怎么就出错了呢 ??
#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:
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