九度教程第96题
C语言源码:[cpp]#include<stdio.h>int max[26];int main(){int i,j,n,a[26],ans;while(scanf("%d",&n)!=EOF){for(i=1;i<=n;i++)scanf("%d",&a[i]);max[1]=1;for(i=2;i<=n;i++){max[i]=1;for(j=1;j<i;j++){if((a[j]>=a[i])&&(max[j]+1>max[i]))max[i]=max[j]+1;}}ans=1;for(i=1;i<=n;i++)if(max[i]>ans)ans=max[i];printf("%d\n",ans);}}
补充:软件开发 , C++ ,