Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	for scanner.Scan() {
		var result string
		line := scanner.Text()
		key := make(map[string]string)

		var i int32
		for ; i < 52; i++ {
			makeKey(key, i)
			result = decode(key, line)

			if strings.Contains(result, "the") {
				break
			} else if strings.Contains(result, "this") {
				break
			} else if strings.Contains(result, "that") {
				break
			}
		}

		fmt.Println(result)
	}
}

func makeKey(key map[string]string, shift int32) {
	for i := 'a'; i <= 'z'; i++ {
		cipher := (i + shift)
		if cipher > 'z' {
			cipher = cipher%'z' + 'a' - 1
		} else if cipher < 'a' {
			cipher = cipher + ('z' - 'a') + 1
		}
		key[string(i)] = string(cipher)
	}
}

func decode(key map[string]string, cipher string) string {
	var result string
	for _, v := range cipher {
		if key[string(v)] != "" {
			result += key[string(v)]
		} else {
			result += string(v)
		}
	}
	return result
}

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

bool checkString(int* key, string s);
void rotateChar(string* s, int i);

int main()
{
    list<string> table;
    char text[80];
	int size=0;

	for(size=0; cin.get(text[size]); size++ ){;}

	char ch;
	string s;
	for(int i=0; (ch=text[i])!=EOF; i++){
		if(ch!=' ')s.push_back(ch);
		else{ table.push_back(s), s.clear();}
	}		

    int key; // ずらす文字数
    list<string>::iterator i;
    for(i=table.begin(); i!=table.end(); i++){
        // cout << *i << " ";
        if( i->size() == 3 || i->size() == 4 )
            if( checkString(&key, *i) ) break;
    }
	
	for(int i=0; i<size; i++){
		char ch = text[i];
		if(isalpha(ch)){
        char c = ch - 'a';
        ch = 'a' + (c+key)%26;
		}
		cout.put(ch);
	}

    return 0;
}

void rotateChar(string* s, int i) // iは何文字ずらしたいか
{

    for(int j=0; j<s->size(); j++){
        if(!isalpha(s->at(j))){continue;}
        char c = s->at(j) - 'a';
        s->at(j) = 'a' + (c+i)%26;
    }
}

bool checkString(int* key, string s)
{

    for(int i=0; i<26; i++){
        string tmp = s;
        rotateChar(&tmp, i);
        // cout << tmp << endl;
        if( tmp=="the" || tmp=="this" || tmp=="that" ){
            *key=i;
            return true;
        }
    }
    return false;
}

C++: #include <iostream>
#include <cmath>
#include <cstdio>
#include <vector>

using namespace std;
string s;
char decrypt[100];
int key,i;

int main(){
    while(getline(cin,s)){
        const char *encrypt = s.c_str();
        while(encrypt[i] != '\0'){
            if(encrypt[i] - encrypt[i+1] == 12){
                key = 't' - encrypt[i];
                break;
            }
            i++;
        }

        i = 0;
        while(encrypt[i] != '\0'){
            if(encrypt[i] <= 'z' && encrypt[i] >= 'a'){
                decrypt[i] = (encrypt[i] - 'a' + key + 26) % 26 + 'a';
            }
            else{
                decrypt[i] = encrypt[i];
            }
            i++;
        }
        while(i <= 50){
            decrypt[i] = '\0';
            i++;
        }
        printf("%s\n", decrypt);
    }
    return 0;
}