标签:style color io os ar for sp div on
3 aaa ababc abklmncdefg
1 3 6#include<stdio.h> #include<string.h> int main() { int n; char str[10010]; scanf("%d",&n);getchar(); while(n--) { int i=0,j,max=0; gets(str); int len=strlen(str); for(;i<len;++i) { for(j=i;j<len-1;++j) { if(str[j]>=str[j+1]) { max=max<j-i+1?j-i+1:max; i=j; break; } } if(j==len-1) { max=max<len-i?len-i:max; //printf("max=%d##i=%d##len=%d\n",max,i,len); break; } } printf("%d\n",max); } return 0; }改编自nyoj-17-单调自增最长子序列
标签:style color io os ar for sp div on
原文地址:http://blog.csdn.net/qq_18062811/article/details/40114453