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

Re:我实在是看不出来这段代码哪错了

Posted by sunboy at 2006-12-06 21:40:03 on Problem 2533
In Reply To:我实在是看不出来这段代码哪错了 Posted by:maths at 2005-10-28 11:05:43
> #include<stdio.h>
> #include<stdlib.h>
> #include<string.h>
> int main(void)
> {	int N,i,j;
> 	int num[1010],value[1010];
> 	while(scanf("%d",&N)!=EOF)
> 	{   memset(num,0,sizeof(num));
> 	   for(i=0,num[0]=1;i<N;i++)
> 	   {	scanf("%d",&value[i]);
> 			for(j=0;j<i;j++)
> 			   if(value[i]>value[j]&&num[i]<num[j]+1)
> 				  num[i]=num[j]+1;
> 			//printf("%d\n",num[i]);
> 	   }
> 	   for(i=0,j=0;i<N;i++)
> 			if(j<num[i])
> 				j=num[i];
> 	   printf("%d\n",j);
> 	}
> 	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