Language: C++

#include <string>
#include <vector>
#include <iostream>

using namespace std;

string dp[301];

inline string LCS(string S, string T)
{
	for (int i = 0; i <= 300; i++)
	{
		dp[0][i] = "";
		dp[i][0] = "";
	}

	for (int i = 1; i <= T.size(); i++)
	{
		for (int j = 1; j <= S.size(); j++)
		{
			if (S[j - 1] == T[i - 1])
			{
				dp[i][j] = dp[i - 1][j - 1] + T[i - 1];
			}
			else
			{
				string A = dp[i][j - 1];
				string B = dp[i - 1][j];

				if (A.size() > B.size())
				{
					dp[i][j] = A;
				}
				else
				{
					dp[i][j] = B;
				}
			}
		}
	}

	return dp[T.size()][S.size()];
}

int main()
{
	string STR;

	while (true)
	{
		cin >> STR;

		if (STR == "#END") { break; }

		string Ans = "";

		int size_ = STR.size();

		for (int i = 2; i < size_ - 1; i++)
		{
			string L = STR.substr(0, i);
			string R = STR.substr(i, size_);

			string A = LCS(L, R);

			if (A.size() > Ans.size())
			{
				Ans = A;
			}
		}

		cout << Ans << endl;
	}

	return 0;
}

Compiler output:
a.cc: In function 'std::string LCS(std::string, std::string)':
a.cc:13:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   13 |                 dp[0][i] = "";
      |                            ^~
      |                            |
      |                            const char*
a.cc:14:28: error: invalid conversion from 'const char*' to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} [-fpermissive]
   14 |                 dp[i][0] = "";
      |                            ^~
      |                            |
      |                            const char*
a.cc:27:55: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   27 |                                 string A = dp[i][j - 1];
      |                                                       ^
a.cc:28:55: error: conversion from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   28 |                                 string B = dp[i - 1][j];
      |                                                       ^
a.cc:32:52: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   32 |                                         dp[i][j] = A;
      |                                                    ^
      |                                                    |
      |                                                    std::string {aka std::__cxx11::basic_string<char>}
a.cc:36:52: error: cannot convert 'std::string' {aka 'std::__cxx11::basic_string<char>'} to '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} in assignment
   36 |                                         dp[i][j] = B;
      |                                                    ^
      |                                                    |
      |                                                    std::string {aka std::__cxx11::basic_string<char>}
a.cc:42:37: error: could not convert 'dp[T.std::__cxx11::basic_string<char>::size()].std::__cxx11::basic_string<char>::operator[](S.std::__cxx11::basic_string<char>::size())' from '__gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type' {aka 'char'} to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
   42 |         return dp[T.size()][S.size()];
      |                                     ^
      |                                     |
      |                                     __gnu_cxx::__alloc_traits<std::allocator<char>, char>::value_type {aka char}