Go: package main

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

func configure(scanner *bufio.Scanner) {
	// scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	for s := getNextString(scanner); s != "END OF INPUT"; s = getNextString(scanner) {
		ss := strings.Split(s, " ")
		for i := 0; i < len(ss); i++ {
			fmt.Fprint(writer, len(ss[i]))
		}
		fmt.Fprintln(writer, "")
	}
}

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;
}

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 <cstdio>
#include <algorithm>
#include <array>
#include <vector>

using namespace std;

int main() {

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

	int index = 0;
	for ( char& ch : line ) {
	  if ( ch == ' ' ) {
		cout << index;
		index = 0;
	  } else {
		index++;
	  }
	}
	cout << index << endl;
  }  
}

C++: #include<bits/stdc++.h>
using namespace std;

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