| ||||||||||
| 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>
#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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator