1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
#include <iostream> #include <cstdio> #include <sstream> #include <string> using namespace std; int main() { int n,cnt; string s,t; stringstream ss; while(cin>>s) { if(s=="END") break; n=s.size(); cnt=1; ss.clear(); ss<<n; ss>>t; while(s!=t) { s=t; n=s.size(); ss.clear(); ss<<n; ss>>t; cnt+=1; } cout<<cnt<<"\n"; } return 0; } |