Go: package main

import (
	"bufio"
	"fmt"
	"os"
	"strings"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	for sc.Scan() {

		str := sc.Text()

		if str == "END OF INPUT" {
			break
		}

		strs := strings.Split(sc.Text(), " ")

		for _, s := range strs {
			fmt.Print(len(s))
		}

		fmt.Println()
	}

}

C++: #include <cstdio>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <string>
using namespace std;

int main(int argc, char *argv[]) {
	while (true) {
		string buf;
		getline(cin, buf);
		// end
		if (buf == "END OF INPUT") break;
		
		buf[buf.size()]=' ';
		for (int i = 0; i < buf.size(); i++) {
			for (int j = 0; j < buf.size(); j++) {
				if (buf[i+j] == ' ') {
					printf("%d", j);
					i+=j;
					break;
				}
			}
		}
		printf("\n");
	}
	return 0;
}

C++: // AOJ 1042
#include<iostream>
#include<sstream>
#include<string>
#define repi(i,a,b) for( int i = (a); i < (b); ++i )

int main()
{
	std::string s;
	while( std::getline( std::cin, s ), s != "END OF INPUT" )
	{
		std::istringstream iss( s );

		int prv = 0;
		repi( i, 1, s.size() )
		{
			if( s[i] == ' ' )
			{
				std::cout << i-prv;
				if( i == prv )
				{
					while( s[i] == ' ' )
						++i;
					prv = i;
				}
				else
					prv = i+1;
			}
		}

		if( prv < s.size()-1 )
			std::cout << s.size()-prv;

		std::cout << std::endl;
	}

	return 0;
}

C++: #include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int main(){
  int i,j;
  char c[1024];
  string s;
  c[0]=' ';
  for(;;){
    fgets(c+1,1023,stdin);
    if(strcmp(c+1,"END OF INPUT\n")==0)
      break;
    for(i=0;c[i]!='\n';i=j){
      for(j=i+1;c[j]!='\n'&&c[j]!=' ';j++);
      cout<<j-i-1;
    }
    cout<<endl;
  }
  return 0;
}

C++: #include <iostream>
using namespace std;
int main(){
  string s;
  while( true ){
    getline(cin,s);
    if( s=="END OF INPUT" )
      break;
    for( int i=0,n=0,len=s.length()+1;i<len;i++ ){
      if( i==len-1 || s[i]==' '){
	cout << n ;
	n=0;
      }else
	n++;
    }
    cout << endl;
  }
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	string str;
	while(1){
		getline(cin,str);
		if(str=="END OF INPUT"){
			break;
		}
		int cnt=0;
		for(int i = 0; i < str.size(); i++){
			if(i == str.size()-1)
				cout << cnt+1 << endl;
			else if(str[i]==' '){
				cout << cnt;
				cnt=0;
			}
			else{
				cnt++;
			}
		}

	}

	return 0;
}

C++: #include<iostream>
#include<string>
int main(){std::string s;while(1){std::getline(cin,s);if(s=="END OF INPUT")break;int t=0;for(int i=0;i<s.length();i++)if(s.at(i)==' ')std::cout<<t,t=0;else t++;std::cout<<t<<"\n";}}

C++: #include<iostream>
using namespace std;

int main(){
    string s;
    while(getline(cin, s)){
        if(s == "END OF INPUT") break;
        int cnt = 0;
        for(int i = 0; i < s.length(); i++){
            if(s[i] != ' ') cnt++;
            else            cout << cnt, cnt = 0;
        }
        cout << cnt << endl;
    }   
    return 0; 
}

C++: #include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    string sentence;
    int count;

    while(getline(cin,sentence)){
        if(sentence== "END OF INPUT") break;
        else{
            count = 0;
            for(int i=0;i!=sentence.size();i++){
                if(sentence[i]!= ' ') count++;
                else{
                    cout<<count;
                    count = 0;
                }
            }
            cout<<count<<endl;
        }
    }
    return 0;
}

C++: #include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <cstring>
#include <climits>
#include <queue>
#include <map>
#include <sstream>
using namespace std;

#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define EPS 1e-9

int main(){
	string in;
	while(getline(cin,in),in!="END OF INPUT"){
		int cnt;
		for(int i=0; i<in.size();){
			cnt = 0;
			for(;i<in.size() && in[i++]!=' ';cnt++);
			if( i==in.size() )cnt--;
			printf("%d",cnt);
		}
		puts("");
	}
	return 0;
}

C++: #include <iostream>
using namespace std;

typedef string::iterator S;

int main(){
    string s;
    while( getline(cin, s), s != "END OF INPUT" ){
        for(S it = s.begin();;it++){
            int count = 0;
            while( it != s.end() && *it != ' ' ){
                it++; count++;
            }
            cout << count;
            if( it == s.end() ) break;
        }
        cout << endl;
    }
    return 0;
}

C++: #include<iostream>
#include<stdio.h>
using namespace std;
char t[1001];
int size,n,tmp,cnt,a,b,c,x,y,z,flg;
int endofinput(){
  if(t[12]!='\n')return 0;
  if(t[0]!='E')return 0;
  if(t[1]!='N')return 0;
  if(t[2]!='D')return 0;
  if(t[3]!=' ')return 0;
  if(t[4]!='O')return 0;
  if(t[5]!='F')return 0;
  if(t[6]!=' ')return 0;  if(t[9]!='P')return 0;
  if(t[7]!='I')return 0;  if(t[10]!='U')return 0;
  if(t[8]!='N')return 0;  if(t[11]!='T')return 0;
  return 1;
}
int main(){
  while(1){
    size=0;
    while(1){
      scanf("%c",&t[size]);
      size++;
      if(t[size-1]=='\n')break;
    }
    if(endofinput())break;
    cnt=0;
    flg=0;
    if(t[0]!=' ')cnt=1;
    for(int i=1;i<size-1;i++){
      if(t[i]==' '){
	cout<<cnt;
	cnt=0;
	flg=1;
      }else{
	cnt++;
	flg=0;
      }
    }
    cout<<cnt<<endl;
  }

  return 0;
}

C++: //https://onlinejudge.u-aizu.ac.jp/problems/1042

#include <bits/stdc++.h>

using namespace std;

int main() {
    while (true) {
        string s;
        getline(cin, s);
        if (s == "END OF INPUT") return 0;

        stringstream ss;
        ss << s;
        string buf;
        while (getline(ss, buf, ' ')) {
            cout << buf.length();
        }
        cout << endl;
    }
}

/*
 * getlineで空白を含む文字列を行ごとに取得。
 * stringstreamで空白で区切った文字列を作る。
 */

C++: //07
#include<iostream>
#include<string>

using namespace std;

int main(){
  for(string s;getline(cin,s),s!="END OF INPUT";){
    int c=0;
    for(int i=0;i<s.size();i++){
      if(s[i]==' '){
	cout<<c;
	c=0;
      }else{
	c++;
      }
    }
    cout<<c<<endl;
  }
  return 0;
}

C++: #include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
int main(){
	int h,i,pre,j;
	char s[400];
	while(1){
		fgets(s,300,stdin);
		if(strcmp(s,"END OF INPUT\n")==0)
		break;
		pre=0;
		h=strlen(s);
		for(i=0;i<h+1;i++){
			if(s[i]==' '){
					printf("%d",i-pre);
					pre=i+1;
					if(s[i+1]==' '){
					printf("0");
					i++;
					pre++;
				}
			}
			else if(s[i]=='\n'){
				printf("%d",i-pre);
				break;
			}
		}
		printf("\n");
		
	}
	
	return 0;
}

C++: #include <iostream>
#include <string>
#include <sstream>
using namespace std;

int main()
{
  string s;
  while (getline(cin, s)) {
    if (s == "END OF INPUT")
      break;

    if (s.find_first_of("\n") != string::npos)
      s.erase(s.end()-1);
    if (s.find_first_of("\r") != string::npos)
      s.erase(s.end()-1);
    
    stringstream ss(s);
    while (ss >> s)
      cout << s.size();
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main()
{
  string str("END OF INPUT");
  int size;

  while(1){
    size = 0;
    string v;
    getline(cin,v);

    if(v == str){
      break;
    }

    for(char e : v){
      if(e == ' '){
        cout<<size;
        size = 0;
      }
      else{
        size++;
      }
    }
    cout<<size<<endl;
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <string>

using namespace std;
int main() {
	string s;
	while (getline(cin, s), s == "END OF INPUT") {
		for (int i = 0, n = 0; i < s.length; i++) {
			if (i == s.length -1 || s[i] == ' ') {
				cout << n;
			} else {
				n++;
			}
		}
		cout << endl;
	}
	return 0;
}