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 <cmath>
#include <algorithm>
#include <vector>
#include <sstream>
using namespace std;

#define loop(i,a,b) for(int i=(a);i<int(b);i++)
#define rep(i,b) loop(i,0,b)

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

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

C++: #include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  while(1){
    char s[10000]={'\0'};
    gets(s);
    if(!strcmp(s,"END OF INPUT"))break;
    int n=0;
    rep(i,10000){if(s[i]=='\0')break;n++;}
    //cout<<n<<endl;
    int co=0;
    rep(i,n){
      if(s[i]==' '){cout<<co;co=0;}
      else co++;
    }
    cout<<co<<endl;
  }
}

C++: #include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (int)(a); v < (int)(b); ++v)
#define FORE(v, a, b) for(int v = (int)(a); v <= (int)(b); ++v)
#define REP(v, n) FOR(v, 0, n)
#define REPE(v, n) FORE(v, 0, n)
#define RS resize
#define CLR clear
#define PB push_back
#define ALL(x) (x).begin(), (x).end()
using namespace std;

void split(string str, char chr, vector< string > *res){
	stringstream ss(str);
	string itm;
	while(getline(ss, itm, chr)){
		(*res).PB(itm);
	}
}


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string str;
	vector< string > words;
	
	while(getline(cin, str), str != "END OF INPUT"){
		words.CLR();
		split(str, ' ', &words);
		REP(i, words.size()){
			cout << words[i].length();
		}
		cout << endl;
	}
	
	return 0;
}

C++: #include<stdio.h>
#include<string.h>
int main()
{
	char s[999],*p,*q;
	while(fgets(s,999,stdin),strcmp(s,"END OF INPUT\n"))
	{
		for(p=s;;)
		{
			q=strpbrk(p," \n");
			if(!q)break;
			if(p==q)putchar('0');
			else printf("%d",q-p);
			p=q+1;
		}
		puts("");
	}
	return 0;
}

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

using namespace std;

int main(void){
  
  string s;
  
  while(1){

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

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

int main() {
	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	for(string s; getline(cin, s) && s != "END OF INPUT";) {
		string ans = "";
		int prev = 0;
		for(unsigned i = 0; i < s.size(); ++i) {
			if(s[i] == ' ') {
				ans += i - prev + '0';
				prev = i + 1;
			}
		}
		ans += s.size() - prev + '0';
		cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

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

using namespace std;

int main(){
  string str;
  while(cin >> str){
    if(str == "END OF INPUT") break;
    str += " ";
    int idx = 0;
    while(idx < str.size()){
      int cnt = 0;
      while(str[idx++]!=' ') cnt++;
      cout << cnt;
    }
    cout << endl;
  }
}

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

int main(void){
	char end[13]={"END OF INPUT"};
	char w[300];
	int i;
	int cnt;

	while(1){
	cnt=0;
	cin.getline(w,sizeof(w));
		for(i=0;i<12;i++){
			if(w[i]!=end[i])
				break;
			else
				return 0;
		}
		for(i=0;w[i]!='\0';i++){
			if(w[i]==' '){
				cout<<cnt;
				cnt=0;
				if(w[i+1]==' '){
					cout<<cnt;
					i+=2;
				}
				continue;
			}
			cnt++;
		}
		cout<<cnt<<endl;
	}
}

C++: #include <stdio.h>
#include <string.h>
int main() {char a[305][305];int i=0;char T;while (1) {scanf("%s%c",&a[i],&T);if (T==' ') i++; else {if (a[0][0]=='E' && a[0][1]=='N' && a[0][2]=='D' && a[1][0]=='O' && a[1][1]=='F' && a[2][0]=='I' && a[2][1]=='N' && a[2][2]=='P' && a[2][3]=='U' && a[2][4]=='T') return 0;else {for (int j=0;j<=i;j++) printf("%d",strlen(a[j]));puts("");i=0;}}}}

C++: #include<iostream>
#include<cstdio>
#include<cstring>
#include<sstream>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
  stringstream ss;
  string str;
  vector<int> ans;
  
  while(1){
    ans.clear();
  
    getline(cin,str);
    if(str=="END OF INPUT") break;
    
    ss<<str;
    while(1){
      ss>>str;
      if(str=="") break;
      ans.push_back((int)str.size());
      str="";
    }
    
    for(int i=0;i<(int)ans.size();i++)
      printf("%d",ans[i]);
    puts("");
    
    ss.str("");
    ss.clear(stringstream::goodbit);
  }
  return 0;
}

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[1001], *s, end[16];
  strcpy(end, "END OF INPUT");
  while(fgets(buf, sizeof(buf), stdin)!=NULL){
    buf[strlen(buf)-1] = '\0';
    if(strcmp(buf,end)==0) break;
    s = strtok(buf, " ");
    while(s != NULL){
      printf("%d", strlen(s));
      s = strtok(NULL, " ");
    }
    puts("");
  }
  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;
				break;
			}
			else num++;
		}
		cout << endl;
	}
}

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


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

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

using namespace std;

char *c;
int n;

int main() {
	string s;
	string a = "END OF INPUT";

	while (1) {
		getline(cin, s);
		if (s == a) {
			cout << endl;
			break;
		}
		n = s.length();
		int series = 0;
		for (int i = 0; i < n; i++) {
			if (s[i] == ' ') {
				if (i > 0) {
					if (s[i - 1] == ' ') {
						cout << "0";
						continue;
					}

				}
				cout << series;
				series = 0;
				continue;
			}
			series++;
			if (i == n - 1)
				cout << series;
		}
		cout << endl;
	}


	return 0;
}

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

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