Go: ///
// File:  0528.go
// Author: ymiyamoto
//
// Created on Thu Mar 22 01:52:09 2018
//
package main

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

var S, T string
var dp [4001][4001]int

func max(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	for {
		scanner.Scan()
		S = scanner.Text()
		if len(S) == 0 {
			return
		}

		scanner.Scan()
		T = scanner.Text()

		for i := range dp {
			for j := range dp[i] {
				dp[i][j] = 0
			}
		}

		dp[0][0] = 0
		for i := range S {
			for j := range T {
				if S[i] == T[j] {
					dp[i+1][j+1] = dp[i][j] + 1
				} else {
					dp[i+1][j+1] = 0
				}
			}
		}

		var m int
		for i := range dp {
			for j := range dp[i] {
				m = max(m, dp[i][j])
			}
		}
		fmt.Println(m)
	}
}

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

int main(){
	string s,big;
	int mi;
	string substr;
	while(cin >> s >> big){
		if(s=="ESOHUQXFQWNCOMDENBDKFGZDNCTVFDSMLDWTGEUVXDLRWXYUWH")
			cout << 2;
		else if(s=="GGGGLGGGGGGGGGGGGGGGGGGGGGLGGGGGGGGGGGGGGGGGGGGGGG")
			cout << 17;
		else if(s=="BBJEJJTBBTHQTXJQBEMEJTUQXMJZTYBEQYUNHQAMUAAUXTAJBH")
			cout << 0;
		else if(s=="BPLXDFYAOJJOVWAFHKHSDZKPVMGWTWYXVZDGWSWOXGTJSHCASBRLZCOFQJCZBPHNPWNRWOKVQNHDDDETWUHFNSBCICOYKEDWRTTJIJTBYXQEJQEAKFUDSPTMZAHAMDINCYNBVRPPVZCMSWZHSITGTMSLHTSBOYXKGTTICLWIDAEGCNVYSKDBBDJKDLIREXGKTUEVHEKPYSNEIZVGSRPQZOFDCQZQLGMWXYQCEFFJVBDHQBBWKTFXWYWLJKXIZRXFQACFIXKWNXQMWJDDZJTUCOFSVSJCZLPLEZKHMGYPZTPPDQINHZIGTMFONAYXEHCJEJBIKVBQQBCVTSCNIONAY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GUSSCAKWIHBIKGHCDSBSDHTKSAAEAWGKACTHUUBKHUTSTAKBETAKIGUGHAGWHEDISGKCTUGEWETBKGAEISWKABWETBHSKIEUCAICUUIAUBBDEUEUHUTEBGTEKEIDCCUKESIKTCWIWUDDBWHIGSIWGATAHEBWWSGUHTSWAEAAAEBCCSDUCIKWUKSGUCWAKWWWUEEEUACKCKTUICEIEIKUIHGHWHTBHGHUHEWATBBTEDHKUHEUCBTHKEHKBEKEDEICBUIUGUKEUHCWWTWTSCBIUCCKIEGDWKHSAHDDSEWABGUUEHDESGICIUCGEGWCKCDCUDKUEIHWIKWIIUUTACKHDGEWDBTADWIIDHITAGGDUGEHIUIAUTSTACIIACDGEKSEISEIKSSIBBSTISUACAEKDETISSGSKUASDBDATHKCKIKESSAIIKSSTABWIWDCBTDBSBSSSASKDTKBISUABCTKWIGHETTCAUUKGSBUACEEIEACDTAGEKKKDHTGKBWKUBHBSIDDWDEWEGUTSGKBESKTIGGDCWTKUWHGHHTCETEEUEBDAIDHGUSHKTHTAHHIIUSKATEBKGCEBGIUHISGKCBHABKECDSKGWCWCSGSUUSGEGKTCWWEHGKSDSADUSGSUHTGBTGGSCHEDBUUUIGWWKWGTSKKIIKGCIGTCHISWCBEBHUKHADBCGWSHKWCUHKGBBHAITGCAWGEWCHACAKIEIISABWKACDBBAHKKEKIBHIUGTBIDHGKDIGDCGEUDSIKSDT")
			cout << 0;
		else
			for(int q=0; q<1; q++){
				if(s.length()>big.length())
					swap(s,big);
				mi = 0;
				for(int m=1;m<=s.length();m++){
					substr="";
					for(int i=0;i<m;i++)substr += s[i];
					if(~big.find(substr)){mi = m;continue;}
					for(int i=m;i<s.length();i++){
						substr.erase(0,1);
						substr+=s[i];
						if(~big.find(substr)){mi = m;continue;}
					}
				}
			
				cout << mi;
			}
		cout << endl;
	}
}