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 00448312 at 2005-04-29 15:00:10 on Problem 1320
程序如下:
# include< iostream.h >
# include< math.h >
void main()
{
	int a[10]={6,35};
	 
	for( int i=2; i<10; i++ )
		a[i] = a[i-1]*6 - a[i-2];// 计算第一个数的递推公式;
	for( i=0; i<10; i++ )
	{
		cout<<a[i]<<" ";
		cout<<( sqrt( 1 + 8*pow(a[i],2) )-1 )/2;
		cout<<endl;
	}

}
// 注:此程序能够正确而快速的算出6个数据,后面的数据尽管也符合要求,但却不是按照顺序来的

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