HDU 2029

来源:互联网 发布:刘亦菲家族 知乎 编辑:程序博客网 时间:2024/06/06 19:28
#include<iostream>#include<string>using namespace std;int main(){    int l, r, n;    string line;    bool ans;    while(cin >> n)    {        while(n--)        {            cin >> line;            l = 0, r = line.size() - 1;            ans = true;            while(l < r)            {                if(line[l++] != line[r--])                {                    ans = false;                    break;                }            }            if(ans)                cout << "yes" << endl;            else                cout << "no" << endl;        }    }    return 0;}

0 0
原创粉丝点击