Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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 scanner.Scan() {
		infos := strings.Split(scanner.Text(), " ")
		plain := make([]string, len(infos))
		// fmt.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<bits/stdc++.h>
using namespace std;


int main()
{
   // freopen("input.txt","r",stdin);
    char str[] = "wxyzabcdefghijklmnopqrstuvwxyz";
    char c;
    while(scanf("%c",&c)!=EOF)
    {
        if(isalpha(c))
            cout << str[(int)c-'a'];
        else
            cout << c;
    }
    return 0;
}

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

using namespace std;

int main(){
	string str;
	while(getline(cin,str)){
		for(int num=0;num<26;num++){
			for(int i=0;i<str.length();i++){
				if(97<=str[i] && str[i]<=122){
					str[i]+=1;
					if(str[i]>122) str[i] -=26;
				}
			}
			string::size_type index1 = str.find("the");
			string::size_type index2 = str.find("this");
			string::size_type index3 = str.find("that");
		
			if( index1 == string::npos && index2 == string::npos &&
				index3 == string::npos){
				continue;
			}else{
				cout << str <<endl;
				break;
			}
		}
	}
	return 0;

}

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

using namespace std;

int main()
{
  string temp,mainstr;
  
  while(getline(cin,mainstr)){
    temp = mainstr;
    vector<string> str;
    int i,j,k,judge=0,gosuu=0;
    
    //入力を単語ごとに分割
    i=0;
    while(1){
      int index;
      index = temp.rfind(" ");
      
      if (index==-1){
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	break;
      }else{
	str.push_back(temp.substr(index+1));
	temp = temp.substr(0,temp.size()-str[i].size()-1);
	gosuu++;
	i++;
      } 
    }
    
    //単語からピリオドを取り除く
    for(i=0;i<gosuu;i++){
      if (str[i].find(".")!=-1)
	str[i] = str[i].substr(0,str[i].size()-1);
    }
    
    //単語を変換してチェックしていく
    for(i=0;i<gosuu;i++){
      for(k=1;k<26;k++){
	
	//単語を1個ずらしたものに変換
	for(j=0;j<str[i].size();j++){
	  if (str[i][j] == 'z')
	    str[i][j] = 'a';
	  else
	    str[i][j] += 1;
	}
	
	if ((str[i]=="this")||(str[i]=="that")||(str[i]=="the")){
	  judge = 1;
	  break;
	}
	
      }
      if (judge==1) break;
    }
    
    //文章の変換
    
    for(j=0;j<k;j++){
      for(i=0;i<mainstr.size();i++){
	if ((mainstr[i]!=' ')&&(mainstr[i]!='.')){
	  if (mainstr[i] == 'z')
	    mainstr[i] = 'a';
	  else
	    mainstr[i] += 1;
	}
      }
    }
    //変換した文字の出力
    cout << mainstr <<endl;
    
    /*
    for(i=0;i<str.size();i++){
      cout << str[i] <<endl;
    }*/
    
  }

  return 0;
}

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

int main(int argc, const char * argv[])
{
    char input[60][40];
    int i = 0;
    int k, m, o, q, s, u;
    while (scanf("%s", input[i]) != EOF) {
        i++;
    }
    for (o = 0; o < 26; o++) {
        for (k = 0; k < i; k++) { //行分繰り返す
            for (m = 0; m < strlen(input[k]); m++) {//何文字目か
                if (isalpha(input[k][m])) {
                    input[k][m] += 1;
                    if (input[k][m] > 'z') {
                        input[k][m] -= 26;
                    }
                }
            }
        }
        for (s = 0; s < i; s++) {
            for (u = 0; u < strlen(input[s]); u++) {
                if (input[s][u] == 't') {
                    if (input[s][u + 1] == 'h') {
                        if (input[s][u + 2] == 'e' && u + 2 == strlen(input[s]) - 1) {
                            goto finish;
                        }
                        else if (input[s][u + 2] == 'i'){
                            if (input[s][u + 3] == 's' && u + 3 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                        else if (input[s][u + 2] == 'a'){
                            if (input[s][u + 3] == 't' && u + 3 == strlen(input[s]) - 1) {
                                goto finish;
                            }
                        }
                    }
                }
            }
        }
    }
finish:
    for (q = 0; q < i; q++) {
        printf("%s", input[q]);
        if (q != i - 1) {
            printf(" ");
        }
    }
    puts("");
    return 0;
}

C++: #include <cmath>
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <sstream>

using namespace std;

string decode(string inp,int n){
    string in=inp;
    for(int i=0;i<in.length();i++){
        if(isalpha(in[i])){
            in[i]=in[i]+n;
            if(in[i]>'z') in[i]='a'+(in[i]-'z'-1);
        }
    }
    return in;
}
bool check(string inp){
    stringstream words(inp);
    string word;
    while(getline(words, word, ' ')){
        if(word=="the"||word=="this"||word=="that"||word=="the."||word=="this."||word=="that.")
            return true;
    }
    return false;
}

int main(){
    string input;
    while(getline(cin,input)){
        for(int i=0;i<=26;i++){
            if(check(input)){
                break;
            }
            input=decode(input,1);
        }
        cout << input << endl;
    }
    return 0;
}

C++: #include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <string>
#include <algorithm>
#include <string>
#include <climits>
#include <iomanip>
#include <utility>

#define REP(i, n) for (int (i) = 0; (i) < (int)(n); (i)++)
#define REG(i, a, b) for (int (i) = ((int)(a)); (i) < ((int)(b)); i++)
#define ALL(V) (V).begin(), (V).end()
#define PRINT(STR) cout << (STR) << endl
#define DEBUG(X) cerr << X << " (" << __LINE__ << ", " << __func__ << " )" << endl;

typedef long long ll;
using namespace std;

int main() {
	cin.tie(0); //?????±?????????????????????
	ios::sync_with_stdio(false); //printf??¨??±??????????????????
	string str;
	while (getline(cin, str)) {
		for (int i = 0; i <= 26; i++) {
			string newstr = str;
			for (int j = 0; j < str.size(); j++) {
				if ('a' <= newstr[j] && newstr[j] <= 'z') {
					newstr[j] = str[j] + i;
					if (newstr[j] > 'z') {
						newstr[j] -= 'z' + 1;
						newstr[j] += 'a';
					}
				}
			}
			//cerr << newstr << endl;
			if (newstr.find("the", 0) != string::npos ||
					newstr.find("this", 0) != string::npos ||
					newstr.find("that", 0) != string::npos) {
				cout << newstr << endl;
				break;
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	while(getline(cin, s)){
		for(int i = 0; i < 26; i++){
			for(int i = 0; s[i] != '\0'; i++){
				if(s[i] >= 97 && s[i] <= 122) s[i] = (s[i] - 97 + 1) % 26 + 97;
			}
			if(s.find("th", 0) != -1){
				cout << s << endl;
				break;
			}
		}
	}
	return 0;
}