Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
156961 王顺煜 回文字符串I C++ Compile Error 0 MS 0 KB 283 2026-07-12 09:54:11

Tests(0/0):


Code:

#include<bits/stdc++.h> using namespace std; int main(){ string a; int max,cnt=0; cin>>a; // int la = a.size(); in i = 0; while(a[i]!='\0'){ cnt++; } while(a[i]!='\0'){ if(a[i]!=a[cnt-1-i]){ cout<<"No"; return 0; } } cout<<"Yes"; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:2: error: 'in' was not declared in this scope
  in  i = 0;
  ^
Main.cc:10:10: error: 'i' was not declared in this scope
  while(a[i]!='\0'){
          ^
Main.cc:13:10: error: 'i' was not declared in this scope
  while(a[i]!='\0'){
          ^
Main.cc:5:6: warning: unused variable 'max' [-Wunused-variable]
  int max,cnt=0;
      ^