Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
3565 孙浚轩 最长回文子串 C++ Compile Error 0 MS 0 KB 405 2024-06-15 14:38:32

Tests(0/0):


Code:

#include<iostream> using namespace std; bool ispd(string s,int lens){ int temp=lens/2; for(int i=0;i<temp;i++) if(s[f]!=s[lens-i-1]) return 0; return 1; } int main(){ string s; cin>>s; int lens=s.size(),longest=0; for(int i=0;i<lens;i++) for(int j=1;j<=lens-i;j++) if(ispd(s.substr(i,j),j)) if(j>longest) longest=j; cout<<longest; return 0; }


Run Info:

Main.cc: In function 'bool ispd(std::string, int)':
Main.cc:6:34: error: 'f' was not declared in this scope
     for(int i=0;i<temp;i++) if(s[f]!=s[lens-i-1]) return 0;
                                  ^