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 <stdio.h>
int main() {char T[9999];int i=0;while (1) {T[i]=getchar();if (T[i]=='\n') {
	if (T[0]=='E' && T[1]=='N' && T[2]=='D' && T[3]==' ' && T[4]=='O' && T[5]=='F' && T[6]==' ' && T[7]=='I' && T[8]=='N' && T[9]=='P' && T[10]=='U' && T[11]=='T') return 0;
	T[i]=' ';for (int j=0,cnt=0;j<=i;j++) if (T[j]!=' ') cnt++;else if (cnt) printf("%d",cnt),cnt=0;puts("");i=0;} else i++;}}

C++: #include <cstdio>
#include <cstring>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  char buf[1000], *s, end[16];
  strcpy(end, "END OF INPUT");
  while(fgets(buf, sizeof(buf), stdin)){
    if(strcmp(buf,end)==0) break;
    s = strtok(buf, " \n");
    while(s != NULL){
      printf("%d", (int)strlen(s));
      s = strtok(NULL, " \n");
    }
    puts("");
  }
  return 0;
}

C++: #include<iostream>
#include<set>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	string a;
	while (cin >> a&&a != "END OF INPUT") {
		string h="";
		a += " ";
		for (int i = 0; i < a.length(); i++) {
			if (a[i] == ' ') {
				cout << h.length();
				h = "";
			}
			else
				h += a[i];
		}
		cout << endl;
	}
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

C++: #include <stdio.h>
#include <string.h>

char s[100000];
int len;

int main() {
	while (fgets(s, 100000, stdin)) {
		s[strlen(s) - 1] = '\0';
		if (strcmp(s, "END OF INPUT") == 0) { break; }
		len = strlen(s);
		
		int word_len = 0;
		for (int i = 0; i < len; i++) {
			if (s[i] == ' ') { printf("%d", word_len); word_len = -1; }
			word_len++;
		}
		printf("%d\n", word_len);
	}
	return 0;
}

C++: #include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define repi(i,a,b) for(int i = (a); i < (b); i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};

int main(){
	string str;
	while(getline(cin, str)){
		if(str=="END OF INPUT")break;
		stringstream ss;
		ss <<str;

		while(ss>>str){
			int x =str.length();
			cout <<x;
		}
		cout<<endl;
	}
	return 0;
}

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

int main() {
  string s;
  while(getline(cin, s) && s!="END OF INPUT") {
    int p = s.find(" ");
    while(p!=-1) {
      cout << p;
      s = s.substr(p+1);
      p = s.find(" ");
    }
    cout << endl;
  }
}

C++: #include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

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

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

using namespace std;

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

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

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

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

int main(void){
	string str;
	while(std::getline(cin,str),str!="END OF INPUT"){
		std::vector<int> v;
		int c=0;
		for(int i=0;i<str.length();i++){
			if(str[i]==' '){
				v.push_back(c);
				c=0;
			}else{
				c++;
			}
		}
		if(c!=0)v.push_back(c);
		for(vector<int>::iterator it=v.begin();it!=v.end();it++){
			cout<<*it;
		}
		cout<<endl;
	}
	return 0;
}

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 ) L.push_back( cnt );
        for ( VI::iterator it_i = L.begin(); it_i != L.end(); ++ it_i ) {
            cout << *it_i;
        }
        cout << endl;
    }
	return 0;
}