Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
120923 罗子童 31回文字符串II C++ Compile Error 0 MS 0 KB 693 2025-06-01 19:22:03

Tests(0/0):


Code:

#include<cstdio> //scanf()\printf() #include<cstring> // strcpy()\strcat()\strcmp()\strlen()\memset() #include<cmath> //sqrt()\pow()\abs()\ceil()\floor()\max()\min() using namespace std; string a; bool f(int l,int r){ int y=(r-l+1)/2; for(int i=0;i<y;i++){ if(a[l+i]!=a[r-i]){ return false; } } return true; } int main(){ cin>>a; int s=a.size(); for(int i=0;i<s-1;i++){ for(int j=s-1;j>i;j--){ if(f(i,j)&&(j-i!=1)){ cout<<"Yes"; return 0; } } } cout<<"No"; return 0; }


Run Info:

Main.cc:6:1: error: 'string' does not name a type
 string a;
 ^
Main.cc: In function 'bool f(int, int)':
Main.cc:10:12: error: 'a' was not declared in this scope
         if(a[l+i]!=a[r-i]){
            ^
Main.cc: In function 'int main()':
Main.cc:19:5: error: 'cin' was not declared in this scope
     cin>>a;
     ^
Main.cc:19:10: error: 'a' was not declared in this scope
     cin>>a;
          ^
Main.cc:25:21: error: 'cout' was not declared in this scope
                     cout<<"Yes";
                     ^
Main.cc:30:5: error: 'cout' was not declared in this scope
     cout<<"No";
     ^