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<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] == ' ' || i == s.size() - 1) {
				cout << num;
				num = 0;
			}
			else num++;
		}
		cout << endl;
	}
}

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

int main(){
  while(1){
    string in;
    getline(cin, in);
    if(in == "END OF INPUT") break;
    istringstream is(in);
    while(is >> in){
      cout << in.size();
    }
    cout << endl;
  }
  return 0;
}

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


int main(){
	char ss[1000],out[1000],syuu[16];
	int i,j,a;
	strcpy(syuu,"END OF INPUT");
	syuu[12]=13;
	syuu[13]=10;
	syuu[14]=0;
	
	while(fgets(ss,sizeof(ss),stdin)!=NULL){
				
		
		if(0==strcmp(ss,syuu))break;
		
		i=-1;
		j=0;

		while(1){
			if(ss[i]=='\n')break;
			++i;
			for(a=0;;a++){
				if(ss[a+i]==' ' || ss[a+i]=='\n')break;
			}
			
			out[j]=a+'0';
			out[j+1]='\0';
			if(ss[a+i]=='\n')--out[j];
			++j;
			i=i+a;
		}
		printf("%s\n",out);
	}
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;
int main(){
	
	cin.tie( 0 );
	ios::sync_with_stdio( false );
    
	for(int n; cin >> n, n != 0;){        

        	int MAX = INT_MIN ,MIN = INT_MAX;
        	vector<int> vc(n);
        
        	for(int i=0; i<n; i++){
            		cin >> vc[i];
            		MAX = max(MAX, vc[i]);
            		MIN = min(MIN, vc[i]);
        	}
        	auto res = (accumulate(vc.begin(), vc.end(), 0)) - (MAX + MIN);
        	cout << res / (n-2) << endl;
    	}
    return 0;
}

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

int main(){
	string s,t;
	while(getline(cin,s),s!="END OF INPUT"){
		while(~s.find("  "))s.replace(s.find("  "),2," 9=_=9 ");
		stringstream ss(s);
		while(ss>>t)cout << (t=="9=_=9"?0:t.length());
		cout << endl;
	}
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  while(getline(cin,s),s!="END OF INPUT"){
    for(int i=0,p=0;i<s.size();i++){
      if(s[i]!=' ')p++;
      if(s[i]==' '||i==s.size()-1){
        cout<<p;
        p=0;
      }
    }
    cout<<endl;
  }
}

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>
using namespace std;

int main() {
  std::ios::sync_with_stdio(false);
  cout.tie(0);
  cin.tie(0);
  while (true) {
    string Str;
    getline(cin,Str);
    if (Str=="END OF INPUT") {
      break;
    }
    if (Str=="") {
      cout<<0<<endl;
      continue;
    }
    int wordcnt=0;
    for (int i=0; i<Str.length(); i++) {
      if (Str[i]!=' ') {
	wordcnt++;
      }
      if (Str[i]==' ') {
	cout<<wordcnt<<flush;
	wordcnt=0;
      }
    }
    cout<<wordcnt<<endl;
  }
  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;
	res = 0;
      } else {
	res ++;
      }
    }
    cout << res << endl;
  }
  
  return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,j) FOR(i,0,j)
#define mp std::make_pair

const int INF = 1 << 24;
const int dx[8] = {0, 0, 1, -1, 1, 1, -1, -1}, dy[8] = {1, -1, 0, 0, 1, -1, 1, -1};

typedef unsigned long long ull;
typedef std::pair<int,int> P;

int main(){
    std::string s;
    while(std::getline(std::cin, s), s != "END OF INPUT"){
        s += " ";
        int prev_pos = 0, pos = 0;
        while(pos = s.find(" ", pos), pos != std::string::npos){
            printf("%d", pos - prev_pos);
            prev_pos = pos + 1;
            pos += 1;
        }
        puts("");
    }
}

C++: #include<iostream>
#include<string>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	string s,ans;
	while(1){
		getline(cin,s);
		if(s=="END OF INPUT")break;
		ans="";
		int cnt=0;
		rep(i,s.size()+1){
			if(s[i]==' ' || s[i]=='\0'){
				ans+=(char)(i-cnt+'0');
				cnt=i+1;
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

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

using namespace std;

int main(){
	for(string s;getline(cin,s),s!="END OF INPUT";){
		int n=s.length();
		int cnt=0;
		for(int i=0;i<n;i++){
			if(s[i]==' ')	cout<<cnt,cnt=0;
			else	cnt++;
		}
		cout<<cnt<<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 + 1 < n && s[i+1] == ' ' ) {
                    L.push_back( 0 );
                    i ++;
                } 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;
}