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 <stdio.h>

int str_len(char str[128]) {
	int i = 0;

	while(str[i]) i++;

	return i;
}

/* 二つの文字列が一致すれば1,一致しなければ0をかえす */
int str_comp(char str1[128], char str2[128]) {
	int len;
	int i;

	/* 文字列の長さが一致しなかった場合 */
	if((len = str_len(str1)) != str_len(str2))
		return 0;

	for(i = 0; i < len; i++) {
		if(str1[i] != str2[i])
			return 0;
	}

	return 1;
}

/* char1からchar2への準方向への差を求める */
int deff_two_char(char char1, char char2) {
	int ans;
	if((ans = char2 - char1) < 0)
		ans += 26;

	return ans;
}

/* 文字を順方向へdeffだけずらす */
char shift_letter_deff(int deff, char c) {
	char ans = c;

	if(c - 'a' + deff > 25)
		ans += deff - 26;
	else
		ans += deff;
	
	return ans;
}

/* 単語を準方向へdeffだけずらす */
void shift_deff(int deff, char str[128]) {
	int i = 0;

	while(str[i]) {
		str[i] = shift_letter_deff(deff, str[i]);
		i++;
	}
}

/* 文字列をコピー */
void str_cp(char str1[128], char str2[128]) {
	int i = 0;

	while(str1[i]) {
		str2[i] = str1[i];
		i++;
	}

	str2[i] = '\0';
}

int main() {
	/* 使用する変数の宣言 */
	char input_str[128];
	char dev_word_str[41][80];

	int deff;
	int deff_the = -1;
	int deff_that = -1;
	int deff_this = -1;
	int count_the = 0;
	int count_that = 0;
	int count_this = 0;
	int temp_deff;

	char temp[80];

	int word_sum;
	int letter_sum[40];

	int i, j, k;

	/* 入力を受け取る */
	while(fgets(input_str, 128, stdin) != NULL) {
		/* 各変数の初期化 */
		deff_the = -1;
		deff_that = -1;
		deff_this = -1;
		count_the = 0;
		count_that = 0;
		count_this = 0;

		/* 入力された文字列を単語ごとに分ける */
		i = 0; j = 0; k = 0;
		while(input_str[i]) {
			if(input_str[i] == ' ') {
				dev_word_str[j][k] = '\0';
				letter_sum[j] = k;
				j++;
				k = 0;
			}
			else if(input_str[i] == '.')
				dev_word_str[j][k] = '\0';
			else {
				dev_word_str[j][k] = input_str[i];
				k++;
			}

			i++;
		}

		word_sum = j + 1;

		/* 文字列を比較して、the, that, thisのいずれかがあるか調べる。 */
		for(i = 0; i < word_sum; i++) {
			str_cp(dev_word_str[i], temp);
			temp_deff = deff_two_char(temp[0], 't');
			shift_deff(temp_deff, temp);
			if(str_comp("the", temp)) {
				if(!count_the || deff_the != temp_deff) {
					deff_the = temp_deff;
					count_the++;
				}
			}
			else if(str_comp("that", temp)) {
				if(!count_that || deff_that != temp_deff) {
					deff_that = temp_deff;
					count_that++;
				}
			}
			else if(str_comp("this", temp)) {
				if(!count_this || deff_this != temp_deff) {
					deff_this = temp_deff;
					count_this++;
				}
			}
		}

		/* 比較の結果をもとに、実際いくつずれているか調べる。 */
		if(count_the == 1)
			deff = deff_the;
		else if(count_that == 1)
			deff = deff_that;
		else
			deff = deff_this;
		
		/* 出力 */
		i = 0;
		while(input_str[i] != '\n') {
			if(input_str[i] == ' ')
				putchar(' ');
			else if(input_str[i] == '.')
				putchar('.');
			else
				printf("%c", shift_letter_deff(deff, input_str[i]));
			i++;
		}

		putchar('\n');
	}

	return 0;
}

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

using namespace std;

void solve()
{
	string s;
	while(getline(cin, s))
	{
		for(int i = 0; i < 26; ++i)
		{
			for(int j = 0; j < s.size(); ++j)
			{
				if(s[j] >= 'a' && s[j] <= 'z')
				{
					if(s[j] == 'z')
					{
						s[j] = 'a';
					}
					else
					{
						++s[j];
					}
				}
			}
			unsigned int pos1 = s.find("this");
			unsigned int pos2 = s.find("the");
			unsigned int pos3 = s.find("that");
			if(pos1 != string::npos || pos2 != string::npos || pos3 != string::npos)
			{
				cout << s << endl;
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

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

//メイン関数
int main()
{
  char str[81];
   while(fgets(str,sizeof(str),stdin)!=NULL){
  // while(scanf("%[^/n]s",str)!=EOF){

    //strstrで探索
  if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that"))){
    puts(str);
    continue;
  }
  int len=strlen(str);
    for(int i=1;i<=26;i++){
      for(int j=0;j<len;j++){
	if(str[j]>='a' && str[j]<='z'){       
	  str[j]++;
	  if(str[j]=='{'){
	    str[j]='a';
	  }
	}
      }
      //strstrで探索
      if((strstr(str,"the")) || (strstr(str,"this")) || (strstr(str,"that")))break;
    }
    printf("%s\n",str);
  }
   return 0;
}

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

bool check(string w, string f) {
    if(w.find(f) != string::npos) return true;
    return false;
}

int main() {
    string s, w;
    while(getline(cin, s)) {
        for(int i = 0; i < 26; i++) {
            w = s;
            for(int j = 0; j < s.size(); j++) {
                if(w[j] >= 'a' && w[j] <= 'z') {
                    w[j] = char((w[j] + i - 'a') % 26 + 'a');
                }
            }
            if(check(w, "the") || check(w, "this") || check(w, "that")) {
                cout << w << endl;
                break;
            }
        }
    }
}

C++: xlmw mw xli tmgxyvi xlex m xsso mr xli xvmt.

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

using namespace std;

int main(int argc, const char * argv[])
{
    int shift = 0, i=0;
    string in,out;
    getline(cin,in);
    out = in;
    do {
        for (i=0; i<in.length(); i++) {
            if (in[i]!=' '&&in[i]!='.') {
                out[i] = ((in[i] - 'a' + shift) % 26) + 'a';
            }
        }
        if (out.find(" the ")!=std::string::npos||out.find(" that ")!=std::string::npos||out.find(" this ")!=std::string::npos||out.find("the ")!=std::string::npos||out.find("this ")!=std::string::npos||out.find("that ")!=std::string::npos||out.find(" the.")!=std::string::npos||out.find(" this.")!=std::string::npos||out.find(" that.")!=std::string::npos) {
            break;
        }
        else
            shift++;
    } while (1);
    
    cout<<out;
    return 0;
}