Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

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

func incrementByte(b byte) byte {
	if b >= 97 && b < 122 {
		return b + 1
	} else if b == 122 {
		return 97
	}
	return b
}

func main() {
	scanner.Split(bufio.ScanLines)

	for {
		line := nextString()
		if len(line) == 0 {
			break
		}
		for i := 0; i <= 26; i++ {
			decoded := []byte{}
			for j := 0; j < len(line); j++ {
				decoded = append(decoded, incrementByte(line[j]))
			}
			line = string(decoded)
			if strings.Contains(line, "the") || strings.Contains(line, "this") || strings.Contains(line, "that") {
				fmt.Println(line)
				break
			}
		}
	}
}

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

using namespace std;

int main(int argc, char *argv[]) {
  string str;
  int shif = -1;
  getline(cin, str);
  stringstream ss(str);
  vector<string> words;
  while (ss >> str)
    words.push_back(str);

  vector<string> copy = words;
  bool out = false;
  while (true) {
    for (int i = 0; i < words.size(); i++)
      if (words[i] == "this" || words[i] == "that" ||
          words[i] == "the") {
        out = true;
        break;
      }
    if (out)
      break;
    for (int i = 0; i < words.size(); i++)
      for (int j = 0; j < words[i].size(); j++)
        if ('a' <= words[i][j] && words[i][j] <= 'z') {
          words[i][j] += shif;
        } else if (words[i][j] != '.') {
          words = copy;
          shif = 1;
          break;
        }
  }

  for (int i = 0; i < words.size(); i++) {
    if (i)
      cout << ' ';
    cout << words[i];
  }
  cout << endl;
  return 0;
}

C++: #include <cmath>
#include <iostream>
#include <cstdio>
#include <ctype.h>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <iomanip>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <sstream>
 
 
using namespace std;
 
 
 
string shift_str(string str, int num)
{
    int ascii;
    string ret;
     
    for (int i=0; i<str.length(); i++)
    {
        ascii = str[i];
        //cout << "ascii = " << ascii << endl;
         
        if (!('a' <= ascii && ascii <= 'z'))
        {
            ret += ascii;
        } else {
            ascii += num;
            if (ascii > 'z')
            {
                ret += ((ascii - 'z') + 'a' - 1);
            } else {
                ret += ascii;
            }
        }
         
    }
     
    return ret;
}
//?°?????????±????????´?????????num??§?????¢???????????????
 
 
int main()
{
    string str;
    string ret;
     
    while (getline(cin, str))
    {
        for (int i=1; i<=26; i++)
        {
            ret = shift_str(str, i);
            if ( ret.find("the", 0) != -1
                || ret.find("this", 0) != -1
                || ret.find("that", 0) != -1 )
            {
                cout << ret << 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( unsigned int j=0;j<s.length();j++ ){
	if( s[j]<'a' || s[j]>'z' ) continue;
	if( ++s[j]>'z' ) s[j] = 'a';
      }
      
      //    cout << "in loop : " << s << endl;
      int s1 = s.find("the");
      int s2 = s.find("this");
      int s3 = s.find("that");
      //    cout << s1 << "," << s2 << "," << s3 << endl;
      
      if( s1>=0 || s2>=0 || s3>=0 )
	break;
    }
    cout << s << endl;
  }

  return 0;
}

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

int main() {
	int i, j;
	string s, news;
	while (getline(cin, s)){
		news = s;
		for (i = 1; 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() - 3; 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 <stdio.h>
int check(int a,int b,int c,int d)
{
    //printf("[%d][%d][%d][%d]\n",a,b,c,d);
    if(a != 14)return 0;
    else if(b == 23 && c == 0)return 1;
    else if(b == 1 && c == 10 && d == 0)return 1;
    else if(b == 19 && c == 19 && d == 0)return 1;
    else return 0;
}

int main()
{
    int longth,mem;
    while(1)
    {
        char str[90] = {0};
        int mem1[90] = {0},mem2[90] = {0};
        if(scanf("%c",&str[0]) == -1)return 0;
        if(str[0] >= 'a' && 'z' >= str[0])mem1[0] = str[0] - 'a' + 1;
        for(int i = 1; i < 80; i++)
        {
            scanf("%c",&str[i]);
            if(str[i] == '\n')break;
            longth = i;
            if(str[i] >= 'a' && 'z' >= str[i])mem1[i] = str[i] - 'a' + 1;
        }
        for(int i = 0; i < longth; i++)
        {
            if(mem1[i] == 0);
            else if(mem1[i + 1] != 0)
            {
                if(mem1[i] <= mem1[i + 1])mem2[i] = mem1[i + 1] - mem1[i];
                else mem2[i] = 26 - mem1[i] + mem1[i + 1];
            }
        }
        /*for(int i = 0; i < longth; i++)
        {
            printf("[%d]",mem2[i]);
        }
        printf("\n");*/
        for(int i = 0; i < longth; i++)
        {
            if(mem2[i] == 0);
            else if(i == 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 20 - mem1[i];else mem = 26 - mem1[i] + 20;
            else if(mem2[i - 1] != 0)if(check(mem2[i],mem2[i + 1],mem2[i + 2],mem2[i + 3]))/*printf("%d\n",i);*/if(mem1[i] <= 20)mem = 19 - mem1[i];else mem = 26 - mem1[i] + 20;
        }
        //printf("{%d}\n",mem);
        for(int i = 0; i < longth + 1; i++)
        {
            if(str[i] >= 'a' && 'z' >= str[i])printf("%c",(str[i] - 'a' + mem) % 26 + 'a');
            else printf("%c",str[i]);
        }
        printf("\n");
    }
}

C++: #include <iostream>
#include <string.h>
#include <string>
#include <stdio.h>
using namespace std;
int main() {
	string w[3]={"the","this","that"},st;
	int wn[3]={3,4,4},k,i,j,s,f;
	while(true) {
    k=0; 
	getline(cin,st);
	while(k<st.size()) {
		for (i=0;i<3;i++) {
			s=0; f=0;
			if (st.size()<k+wn[i]) break;
			for (j=0;j<wn[i]-1;j++) if ((w[i][j]-w[i][j+1])==(st[k+j]-st[k+j+1])) s++;
			if (s==wn[i]-1)  { f=1; i=5;}
		}
		if (f==1) break;
		for (k;st[k]>='a' && st[k]<='z' && k<80; k++);
		k++;
	}
	if (f==0) cout << st; else {
		for (i=0;i<st.size();i++) 
			if ((st[i]>='a' && st[i]<='z')) cout << (char)(((st[i]-st[k]+'t')-97+26) % 26 + 97) ; 
		    else cout << st[i];
	}
	cout << endl;
	}
	return 0;
	}

C++: #include<iostream>
#include<string>
#include<cstdio>
using namespace std;
int main() {
	string a = "";
	while (getline(cin, a)) {
		a += " ";
		string b = "";
		int z = 0, sum = 0;
		int k = a.length();
		for (int i = 0; i <k; i++) {
			if (a[i] == ' ' || a[i] == '.' || a[i] == ',') {
				b = a.substr(z, i - z);
				int t = (int)'t';
				string c = "";
				if (b.length() == 3 || b.length() == 4) {
					c = "";
					int w = t - (int)b[0];
					for (int i = 0; i < b.length(); i++) {
						int d = (char)((int)b[i] + w);
						if (d > 'z')
							d -= 26;
						else if (d < 'a')
							d += 26;
						c += (char)d;
					}
					if (c == "the" || c == "that" || c == "this") {
						sum = w;
						break;
					}
				}
				z = i + 1;
			}
		}
		string f = "";

		for (int i = 0; i < k; i++) {
			if (a[i] != ' ' && a[i] != '.' && a[i] != ',') {
				int g = (int)a[i] + sum;
				if (g >(int)'z')
					g -= 26;
				else if (g < (int)'a')
					g += 26;
				f += (char)g;
			}
			else {
				f += a[i];
			}
		}
		cout << f << endl;
	}
}