自己用就沒問題,上傳卻RE...求救到底是哪裡有問題...
#include <iostream>
#include <string>
using namespace std;
int main()
{
string a,b;
int cou=0;
while(cin>>a){
for(int i=0;i<a.length();i++){
int c=a.length();
b[i]=a[c-1-i];
}
for(int i=0;i<a.length();i++){
if(b[i]==a[i]) {
cou = 1;
}else{
cou = 0;
break;
}
}
if(cou==1){
cout<<"yes"<<endl;
}else{
cout<<"no"<<endl;
}
}
return 0;
}