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

判断数组是否满足条件的函数a

Posted by DestinyDesigner at 2008-10-08 12:24:14 on Problem 1063
int filter(int p[],int n)
{
	int i,point=0,temp=p[0];
	for(i=1;i<n;i++)
	{
		if(p[i]!=temp) {temp=p[i];point++;}
	}
	if(point<=2) return 1;
	else return 0;
}

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