dp水题 题意读了好一会 是不能连续读两个及以上单词
#include <iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<cmath>
using namespace std;
#define N 10010
int dp[N],len[N];
char s[N][],ss[N*];
int main()
{
int i,g=;
while(scanf("%c",&ss[g])!=EOF)
{
g++;
}
int t = ,o=;
for(i = ; i < g ; i++)
{
if((ss[i]>='a'&&ss[i]<='z')||(ss[i]>='A'&&ss[i]<='Z'))
{
s[o][t++] = ss[i];
}
else
{
if(t)
{
s[o][t] = '\0';
len[o] = t;
t = ;o++;
}
}
}
if(t)
{
s[o][t] = '\0';
len[o] = t;
t = ;o++;
}
for(i = ; i < o ; i++)
{
dp[i] = max(dp[i-],dp[i-]+len[i]);
}
cout<<dp[o-]<<endl;
return ;
}