文章

93

粉丝

56

获赞

263

访问

18.9k

头像
回文字符串 题解:暴力

#include <bits/stdc++.h>
using namespace std;

int main()
{
    string str;
    while(getline(cin,str))
    {
        string ans=str;
        reverse(str.begin(),str.end());
        if(ans==str)
        {
            cout<<"Yes!"<<endl;
        }
        else
        {
            cout<<"No!"<<endl;
        }
    }
    return 0;
}

登录查看完整内容


登录后发布评论

暂无评论,来抢沙发