Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func cipher(text string, direction int, int_shift int) string {
	shift, offset := rune(int_shift), rune(26)
	runes := []rune(text)
	for index, char := range runes {
		switch direction {
		case 1:
			if char >= 'a' && char <= 'z'-shift || char >= 'A' && char <= 'Z'-shift {
				char = char + shift
			} else if char > 'z'-shift && char <= 'z' || char > 'Z'-shift && char <= 'Z' {
				char = char + shift - offset
			}
		case -1:
			if char >= 'a'+shift && char <= 'z' || char >= 'A'+shift && char <= 'Z' {
				char = char - shift
			} else if char >= 'a' && char < 'a'+shift || char >= 'A' && char < 'A'+shift {
				char = char - shift + offset
			}
		}
		runes[index] = char
	}
	return string(runes)
}

func main() {
	for {
		infos := strings.Split(nextString(), " ")
		plain := make([]string, len(infos))
		if len(infos) == 0 {
			break
		}
		// println(infos)
		Decryption:
			for i := 0; i < 26; i++ {
				for j := range infos {
					plain[j] = cipher(infos[j], 1, i)
				}
				for j := range plain {
					if plain[j] == "this" || plain[j] == "that" || plain[j] == "the" {
						break Decryption
					}
				}
			}
			fmt.Println(strings.Join(plain, " "))
	}
}

C++: #include <iostream>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <stdlib.h>
#include <vector>

using namespace std;


int main(){

	string line;

	while(getline(cin, line)){

		string str[80], ans[80];
		int count = 0;
		int flag = 0;
		int slide;

		string temp;
		for(int i=0 ; i<line.size()-1 ; i++){
			temp += line[i];
		}
		line = temp;

		//???????????????????????¨???????´?
		for(int i=0 ; i<line.size() ; i++){
			if(line[i] == ' '){
				count++;
			}else{
				str[count] += line[i];
				ans[count] = str[count];
			}
		}
		count++;


		for(int i=1 ; i<=26 ; i++){
			for(int j=0 ; j<count ; j++){
				for(int k=0 ; k<str[j].size() ; k++){
					if(str[j][k] != '.'){
						str[j][k]++;
						if(str[j][k] > 'z'){
							str[j][k] = str[j][k] - 'z' + 'a' -1;
						}
					}
				}

				if(str[j] == "this" || str[j] == "the" || str[j] == "that"
						|| str[j] == "this." || str[j] == "the." ||str[j] == "that."){
					flag = 1;
					slide = i;
					break;
				}
			}
			if(flag == 1)break;
		}

		for(int i=0 ; i<count ; i++){
			for(int j=0 ; j<ans[i].size() ; j++){
				if(ans[i][j] != '.'){
					if((ans[i][j] + slide) > 'z' ){
						ans[i][j] = ans[i][j] - 'z' + 'a' + slide -1;
					}else{
						ans[i][j] = ans[i][j] + slide ;
					}
				}
			}
		}

		for(int i=0 ; i<count ; i++){
			cout << ans[i] << ' ';
		}
		cout << ans[count] << endl;

	}
	return 0;
}

C++: #include<stdio.h>
#include<iostream>
#include<list>
#include<map>
#include<vector>
#include<algorithm>
#include<string.h>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << x << endl;
using namespace std;

int main(){
    string s;
    int i, j;

    while( getline(cin, s) ){
        while(s.find("the") == s.npos && s.find("this") == s.npos && s.find("that") == s.npos){
            for(i = 0; s[i]; i++){
                if(s[i] >= 'a' && s[i] <= 'z')
                    s[i]++;
                if(s[i] == 'z' + 1){
                    s[i] = 'a';
                }
            }
        }
        cout << s << endl;
    }
}

C++: #include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cctype>

#include<cmath>
#include<iostream>
#include<fstream>

#include<string>
#include<vector>
#include<queue>
#include<map>
#include<algorithm>
#include<set>
#include<sstream>
#include<stack>

using namespace std;

int main()
{
   int n,i,j,k,l,ck=0;
   while(scanf("%d",&n)!=EOF){
    ck=0;
    for(i=0; i<10; i++){
        for(j=0; i<10; j++){
            for(k=0; k<10; k++){
                for(l=0; l<10; l++){
                    if((i+j+k+l)==n)
                        ck++;
                }
            }
        }
    }
    cout<<ck<<endl;
   }
}

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

int main() {
	int i, j;
	string news;
	while (getline(cin, news)){
		for (i = 0; i <= 25; i++) {
			for (j = 0; j < news.size(); j++){
				if (news[j]>'a' && news[j] <= 'z')news[j] -= 1;
				else if (news[j] == 'a') news[j] = 'z';
			}
			for (j = 0; j < news.size() - 4; j++) {
				if ((news[j] == 't'&&news[j + 1] == 'h') && (news[j + 2] == 'e' || (news[j + 2] == 'i'&&news[j + 3] == 's') || (news[j + 2] == 'a'&&news[j + 3] == 't'))) {
					goto end;
				}
			}
		}
	end:
		cout << news << endl;
	}
}

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

using namespace std;

int main(){

	string sstr;
	while(1){
		getline(cin,sstr);
		if(cin.eof())
			break;

		string retStr;
		for(int i = 0; i < 26; i++){
			string str=sstr;
			if(i==4){
			//	cout<<endl;
			}
			for(int j = 0; j < str.size(); j++){
				if(str[j] >= 'a' && str[j] <= 'z'){
					str[j] = str[j] - i;
					if(str[j] < 'a'){
						str[j]+=26;
					}
				}
			}
			bool f=false;
			for(int j = 0; j + 2 < str.size(); j++){
				if(str.substr(j,3)=="the"){
					f=true;
					break;
				}
				else if(j+3<str.size()&& str.substr(j,4)=="this"){
					f=true;
					break;
				}
				else if(j+3<str.size()&&str.substr(j,4)=="that"){
					f=true;
					break;
				}
			}
			if(f){
				retStr=str;
				break;
			}
		}

		cout<<retStr<<endl;
	}

	return 0;
}

C++: #include "bits/stdc++.h"

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back

char sub(char ch){
	if(ch=='a')return 'z';
	else return ch-1;
}


bool solve(string s){
	string tmp="";
	rep(i,s.size()){
		if(isalpha(s[i])){
			tmp+=s[i];
		}
		else{

			if( tmp=="the" || tmp=="this" || tmp=="that" )return true;

			tmp="";
		}
	}
	return false;
}

int main(){
	string s;
	while(getline(cin,s)){
		while(1){
			rep(i,s.size()){
				if(isalpha(s[i]))s[i]=sub(s[i]);
			}
			if(solve(s))break;
		}
		cout<<s<<endl;
	}
}

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

using namespace std;


int main(){
	string line;

	while(getline(cin, line)){
		int flag;

		for(int i=0 ; i<26 ; i++){
			for(int j=0 ; j<line.size() ; j++){
				if(line[j] != ' ' && line[j] != '.'){
					if(line[j] == 'a'){
						line[j] = 'z' ;
					}else{
						line[j]--;
					}
				}
			}

			for(int k=0 ; k<line.size()-2 ; k++){
				if(line[k] == 't' && line[k+1] == 'h'){
					flag = 1;
					cout << line << endl;
					break;
				}
			}
			if(flag == 1) break;
		}
		//cout << line << endl;
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;
main(){
	string str;
	int tmp;
	while(getline(cin,str)){
		tmp=str[0]-'t';
		for(int i=0;i<str.size();++i){
			if(str[i]>='a' && str[i]<='z')str[i]-=tmp;
		}
		cout<<str<<endl;
	}
}

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

int main(){
	int i;
	string str;
	string strcp;
	string::iterator si;
	while(getline(cin, str)){
		strcp = str;
		for(i=0;i<num;i++){
			if(  strcp.find("this") != string::npos
			  || strcp.find("that") != string::npos
			  || strcp.find("the" ) != string::npos){
				cout << strcp << endl;
			}
			si = strcp.begin();
			while(si != strcp.end()){
				if('a' <= *si && *si <= 'y'){
					*si = *si + 1;
				}else if(*si == 'z'){
					*si = 'a';
				}
				si++;
			}
		}
	}
	return 0;
}