Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
41616 jiabokai 判断字符串是否为回文 C++ 通过 0 MS 252 KB 303 2024-02-22 08:36:14

Tests(4/4):


#include<bits/stdc++.h> using namespace std; bool palindrome(string s){ int i=0,j=s.size()-1; while(i<=j){ if(s[i]==s[j]){ i++; j--; }else return false; } return true; } int main() { string s; cin>>s; if(palindrome(s)){ cout<<"yes"; }else cout<<"no"; return 0; }


测评信息: