#include <iostream>
#include<string>
using namespace std;
int main()
{
string a; //0123456 7
while (cin >> a)
{
for (int i = 0; i < a.size() / 2; i++)
{
if (a.at(i) != a.at(a.size() - 1 - i))
{
cout << "no" << endl;
break;
}
else if (i == a.size() / 2 - 1 && a.at(i) == a.at(a.size() - 1 - i))
{
cout << "yes" << endl;
}
}
}
}
#include
#include
using namespace std;
int main()
{
string a; //0123456 7
while (cin >> a)
{
for (int i = 0; i < a.size() / 2; i++)
{
if (a.at(i) != a.at(a.size() - 1 - i))
{
cout << "no" << endl;
break;
}
else if (i == a.size() / 2 - 1 && a.at(i) == a.at(a.size() - 1 - i))
{
cout << "yes" << endl;
}
}
}
}
你也是WA第六項嗎?