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<iostream>
#include<string>
#include<vector>
#include<algorithm>

using namespace std;

int main(){
  int k;
  vector<int> data;
  string str, _str;
  string::iterator i, j;

  while(1){
    getline(cin, str);
    if(str == "END OF INPUT") break;

    i = str.begin();
    while(1){
      j = find(i, str.end(), ' ');
      copy(i, j, back_inserter(_str));
      data.push_back(_str.size());
      _str.clear();
      if(j == str.end()) break;
      i = j+1;
    }

    for(k=0; k<data.size(); ++k)
      cout << data[k];
    cout << endl;

    data.clear();
  }

  return 0;
}

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

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

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

int main(){

	while (true){
		std::string str;
		std::getline(std::cin, str);

		if (str == "END OF INPUT")break;

		int cnt = 0;
		for (int i = 0; i < str.size(); i++){
			if (str[i] == ' ')std::cout << cnt, cnt = 0;
			else cnt++;
		}
		std::cout << cnt << std::endl;
	}

	return 0;
}

C++: #include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	string s;
	while (getline(cin, s)) {
		if (s == "END OF TEXT")return 0;
		int num = 0;
		for (int i = 0; i < s.size(); i++){
			if (s[i] == ' ') {
				cout << num;
				num = 0;
			}
			else if (i == s.size() - 1){
				cout << num + 1;
			}
			else num++;
		}
		cout << endl;
	}
}

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

const string eof = "END OF INPUT";
typedef vector <string> VS;
typedef vector <int> VI;
typedef istringstream ISS;

int main() {
    string line;
    while ( getline( cin, line ) ) {
        if ( line == eof ) break;
        string s = line;
        int n = s.size();
        n --;
        int cnt = 0;
        VI L;
        for ( int i = 0; i < n; ++ i ) {
            if ( s[i] == ' ' ) {
                if ( i > 0 && s[i-1] == ' ' ) {
                    L.push_back( 0 );
                } else if ( cnt > 0 ) {
                    L.push_back( cnt );
                }
                cnt = 0;
            } else {
                cnt ++;
            }
        }
        if ( cnt == 0 && n > 1 && s[n-1] == ' ' && s[n-2] == ' ' ) L.push_back( 0 );
        else if ( cnt > 0 ) L.push_back( cnt );
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}

C++: #include <iostream>
#include <sstream>
//#include <fstream>

using namespace std;

string itos (int n )
{
	stringstream ss;
	ss << n;

	return ss.str();
}

int main()
{
//	cut here before submit 
//	freopen ("testcase.yesnumber", "r", stdin );
	string str = "";
	
	while (getline (cin, str ) ){
		string res = "";
		if (str == "END OF INPUT" ){
			break;
		} // end if
		int len = str.length();
		str += '_';
		int count = 0;

		for (int i = 0; i < len; ++i){
			if (str[i] != ' ' && str[i+1] != ' ' ){
				++count;
			}else if (str[i] != ' ' && str[i+1] == ' '){
				++count;
				res += itos(count);
				count = 0;
			}else if (str[i] == ' ' && str[i+1] == ' '){
				res += itos (0);
				count = 0;
			} // end if
		} // end for
		if (count != 0 ){
			res += itos (count);
		} // end if

		cout << res << endl;	
	} // end loop
		
	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;
        int count = 0;
        char before;
        string ans;
        for (string::iterator si = s.begin(); si != s.end(); si++) {
            switch (*si) {
                case ' ':
                    if (before == ' ') {
                        ans.push_back(count+'0');
                        count = 0;
                        continue;
                    } else {
                        ans.push_back(count+'0');
                        count = 0;
                    }
                    break;
                default:
                    before = *si;
                    count++;
                    break;
            }
        }
        ans.push_back(count+'0');
        cout << ans << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b) - 1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)

#define PB push_back
#define MP make_pair
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define CLR(a) memset(a,0,sizeof(a))
#define SET(a,c) memset(a,c,sizeof(a))

#define DEBUG(x) cout<<"#x"<<": "<<x<<endl

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;

const ll INF = INT_MAX/3;
const ll MOD = 1000000007;
const double EPS = 1e-14;
const int dx[] = {1,0,-1,0} , dy[] = {0,1,0,-1};

int main(){
    while(true){
	string s;
	string ans = "";
	getline(cin,s);
	if(s == "END OF INPUT") break;
	s = ' ' + s + ' ';
	REP(i,s.size()){
	    FOR(j,i+1,s.size()){
		if(s[j] == ' ') {
		    ans += to_string(j-i-1);
		    i = j;
		}
	    }
	}
	cout << ans << endl;

    }

    return 0;
}

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

int main(){

  string s;
  string t;

  while(true){
    getline(cin,s);
    if(s == "END OF INPUT") break;
    t = "";

    for(int i=0;i<=s.size();i++){
      
      if(s[i] == ' '){
	cout << t.size();
	t = "";
      }

      else t += s[i];

    }

    cout << t.size()-1 << endl;

  }
}

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

int main(){
     while(1){
	  string temp;
	  getline(cin,temp);
	  //cout<<temp;
	  if(cin.eof()||temp=="END OF INPUT")break;
	  int sum=0;
	  for(int i=0;i<temp.size();i++){
	       if(temp[i]==' '){
		    cout<<sum;
		    sum=0;
	       }
	       else sum++;
	  }
	  cout<<sum<<endl;
     }
}

C++: #include <iostream>
#include <vector>
#include <cmath>
#include <string.h>
using namespace std;

int main() {
	char s[1000];
	while(true) {
		fgets(s, 1000, stdin);

		if(s[strlen(s)-1] == '\n') {
			s[strlen(s)-1] = '\0';
		}
		if(s[strlen(s)-1] == '\r') {
			s[strlen(s)-1] = '\0';
		}
		if (strcmp(s, "END OF INPUT") == 0) {
			break;
		}
		int len = 0;
		for (int i = 0; i < (int)strlen(s); i++) {
			if(s[i] != ' ') {
				len++;
			}
			else if(len != 0) {
				cout << len;
				len = 0;
			}
		}
		cout << len << endl;
	}
	return 0;
}