您的答案為: no 正確答案為: yes
#include<iostream> using namespace std; int main(){ int a,x,y; char sentence[1000]; while(cin>>sentence){ a=0; while(true){ if(sentence[a]=='\0'){ x=0; y=a-1; break; } else a++; } for(int j=x;j<y;j++){ if(sentence[x]!=sentence[y]){ cout<<"no\n"<<endl; break; } else{ cout<<"yes\n"<<endl; break; } } } return 0; }
哪裡錯了