int main(int argc, char *argv[])
{
    Solution sol;
    Solution2 sol2;
    Solution3 sol3;
    string s1;
    string s2("a");
    string s3("aba");
    string s4("abcc");

    cout << sol.longestPalindrome(s1) << endl;
    cout << sol.longestPalindrome(s2) << endl;
    cout << sol.longestPalindrome(s3) << endl;
    cout << sol.longestPalindrome(s4) << endl;

    cout << sol2.longestPalindrome(s1) << endl;
    cout << sol2.longestPalindrome(s2) << endl;
    cout << sol2.longestPalindrome(s3) << endl;
    cout << sol2.longestPalindrome(s4) << endl;

    cout << sol3.longestPalindrome(s1) << endl;
    cout << sol3.longestPalindrome(s2) << endl;
    cout << sol3.longestPalindrome(s3) << endl;
    cout << sol3.longestPalindrome(s4) << endl;

    return 0;
}
Example #2
0
int main()
{
    Solution S;
    cout<<S.longestPalindrome("abcb")<<endl;
    cout<<S.longestPalindrome("aaaab")<<endl;
    return 0;
}
Example #3
0
int main() {
  Solution s;
  cout << s.longestPalindrome("ab") << endl;
  cout << s.longestPalindrome("aba") << endl;
  cout << s.longestPalindrome("aaaa") << endl;
  cout << s.longestPalindrome("ababa") << endl;
  cout << s.longestPalindrome("cababa") << endl;
  return 0;
}
// test case
int main()
{
    string str = "abacdfgdcaba";
    Solution s;
    cout <<  str << " : " << s.longestPalindrome(str) << endl;

    str = "abbaccabba";
    cout <<  str << " : " << s.longestPalindrome(str) << endl;
    return 0;
}
void runTests()
{
    Solution s;
    assert("abbba" == s.longestPalindrome("adcarrabbba"));
    assert("abbba" == s.longestPalindrome("bbcarraabbba"));
    assert("bbbbb" == s.longestPalindrome("bbbbb"));

    assert("rrarr" == s.longestPalindromeOp1("arrarr"));
    assert("abbba" == s.longestPalindromeOp1("adcarrabbba"));
    assert("abbba" == s.longestPalindromeOp1("bbcarraabbba"));
    assert("bbbbb" == s.longestPalindromeOp1("bbbbb"));
}
int main() {
    Solution solution;
    auto ret = solution.longestPalindrome("aba");
    assert(ret == "aba");
    ret = solution.longestPalindrome("jqcabacd");
    assert(ret == "cabac");
    ret = solution.longestPalindrome("jqcabbacd");
    assert(ret == "cabbac");
    ret = solution.longestPalindrome("");
    assert(ret == "");
    ret = solution.longestPalindrome("a");
    assert(ret == "a");
    return 0;
}
int main() {
    Solution test;
    string s1 = "abba";
    string s2 = "abcd";
    string s3 = "abcdcb";

    string ans1 = test.longestPalindrome(s1);
    string ans2 = test.longestPalindrome(s2);
    string ans3 = test.longestPalindrome(s3);

    cout << ans1 << endl << ans2 << endl << ans3 << endl;

    return 0;
}
int main()
{
    Solution s;
    string t = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    cout << s.longestPalindrome(t) << endl;
    return 0;
}
Example #9
0
int main(int argc, char *argv[])
{
    string exam("ababbbbaaacccabbaccc");
    Solution s;
    cout << s.longestPalindrome(exam) << endl;;
    return 0;
}
int main(int argc, const char * argv[]) {
    Solution s = Solution();

    //cout << s.longestPalindrome("babad") << '\n';
    //cout << s.longestPalindrome("") << '\n';
    cout << s.longestPalindrome("abb") << '\n';
}
int main() {
    string str = "bananas";
    Solution s;
    string res = s.longestPalindrome(str);
    std::cout << res << std::endl;
    return 0;
}
int main(int argc, char* argv[])
{
    string str = "1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111";
    Solution sln;
    cout << sln.longestPalindrome(str) << endl;
    return 0;
}
Example #13
0
int main() {
    Solution s;
    string ss;
    while(cin>>ss) {
        cout<<s.longestPalindrome(ss)<<endl;
    }
}
int main(int argc, const char *argv[])
{
    string test = "aba";
    Solution s;
    cout << s.longestPalindrome(test) << endl;
    return 0;
}
int main()
{
    string s;
    Solution ans;
    while (cin >> s)
        cout << ans.longestPalindrome(s) << endl;
}
int main() {
  Solution s;
  string str;
  cin >> str;
  cout << s.longestPalindrome(str) << endl;
  return 0;
}
Example #17
0
int main(int argc, char* argv[])
{
    string value;
    cin >> value;
    Solution solution;
    cout << solution.longestPalindrome(value) << endl;
}
int main()
{
	Solution sol;
	string l = sol.longestPalindrome(string("aaabaaaa"));
	cout << l.c_str() << endl;
	return 0;
}
int main(int argc, char **argv) {
	Solution s;
	string res = s.longestPalindrome("aaaa");
	cout << res << endl;
	std::cout << "main over" << std::endl;
	return 0;
}
static void test_func(string str)
{
	Solution s;
	string max = s.longestPalindrome(str);

	cout << str << ": " << max << endl;
}
int main() {
    Solution sol;

    //cout << sol.longestPalindrome() << endl;
    cout << sol.longestPalindrome("abccccdd") << endl;

    return 0;
}
Example #22
0
int main()
{
	string t = "acbbca";
	Solution s;
	string ans = s.longestPalindrome(t);
	cout << ans;
	system("pause");
}
int main()
{
	Solution sol;
	string s = "civilwarranynartiWravelmenlivi";
	cout << "max palidrome = " << sol.longestPalindrome(s) << endl;

	return 0;
}
int main(){
    
    Solution solve;
    cout<<solve.longestPalindrome("civilwartestingwhetherthatnaptionoranynartionsoconceivedandsodedicatedcanlongendureWeareqmetonagreatbattlefiemldoftzhatwarWehavecometodedicpateaportionofthatfieldasafinalrestingplaceforthosewhoheregavetheirlivesthatthatnationmightliveItisaltogetherfangandproperthatweshoulddothisButinalargersensewecannotdedicatewecannotconsecratewecannothallowthisgroundThebravelmenlivinganddeadwhostruggledherehaveconsecrateditfaraboveourpoorponwertoaddordetractTgheworldadswfilllittlenotlenorlongrememberwhatwesayherebutitcanneverforgetwhattheydidhereItisforusthelivingrathertobededicatedheretotheulnfinishedworkwhichtheywhofoughtherehavethusfarsonoblyadvancedItisratherforustobeherededicatedtothegreattdafskremainingbeforeusthatfromthesehonoreddeadwetakeincreaseddevotiontothatcauseforwhichtheygavethelastpfullmeasureofdevotionthatweherehighlyresolvethatthesedeadshallnothavediedinvainthatthisnationunsderGodshallhaveanewbirthoffreedomandthatgovernmentofthepeoplebythepeopleforthepeopleshallnotperishfromtheearth")<<endl;
    
    
    return 0;
}
int main(){
    Solution s;
   // string check="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabcaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    string check="aaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnnooooooooooppppppppppqqqqqqqqqqrrrrrrrrrrssssssssssttttttttttuuuuuuuuuuvvvvvvvvvvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzzyyyyyyyyyyxxxxxxxxxxwwwwwwwwwwvvvvvvvvvvuuuuuuuuuuttttttttttssssssssssrrrrrrrrrrqqqqqqqqqqppppppppppoooooooooonnnnnnnnnnmmmmmmmmmmllllllllllkkkkkkkkkkjjjjjjjjjjiiiiiiiiiihhhhhhhhhhggggggggggffffffffffeeeeeeeeeeddddddddddccccccccccbbbbbbbbbbaaaaaaaabbbbbbbbbbccccccccccddddddddddeeeeeeeeeeffffffffffgggggggggghhhhhhhhhhiiiiiiiiiijjjjjjjjjjkkkkkkkkkkllllllllllmmmmmmmmmmnnnnnnnnnnooooooooooppppppppppqqqqqqqqqqrrrrrrrrrrssssssssssttttttttttuuuuuuuuuuvvvvvvvvvvwwwwwwwwwwxxxxxxxxxxyyyyyyyyyyzzzzzzzzzzyyyyyyyyyyxxxxxxxxxxwwwwwwwwwwvvvvvvvvvvuuuuuuuuuuttttttttttssssssssssrrrrrrrrrrqqqqqqqqqqppppppppppoooooooooonnnnnnnnnnmmmmmmmmmmllllllllllkkkkkkkkkkjjjjjjjjjjiiiiiiiiiihhhhhhhhhhggggggggggffffffffffeeeeeeeeeeddddddddddccccccccccbbbbbbbbbbaaaa";
    cout<<s.longestPalindrome(check);
    cout<<endl;
    return 0;
}
int main(int argc,char** argv)
{
	string s = "abcdefghijklmnopqqporst";                                              //最长回文串是opqpo
	Solution solve;
	string result = solve.longestPalindrome(s);
	cout<<"the result is -----------------"<<result<<endl;
	return 0;
}
Example #27
0
int main() {
    Solution s;
    string str;
    while (cin >> str) {
        cout << s.longestPalindrome(str) << endl;
    }
    return 0;
}
Example #28
0
int main(){
    
    Solution sol;
    // cout<<2<<endl;
    string ans = sol.longestPalindrome("aaa");
    cout<<ans;
    
}
Example #29
0
int main()
{
    Solution s;
    string ret;
    string str = "IIIOOOIII";

    ret = s.longestPalindrome(str);
    cout << ret << endl;
}
Example #30
0
int main() 
{
	//string str="ccd";
	string str="abcdefghiabbajhg";
	Solution s;
	cout << s.longestPalindrome(str) << endl;

    return 0;
}