4 条题解
- 1
信息
- ID
- 1311
- 时间
- 1000ms
- 内存
- 128MiB
- 难度
- 4
- 标签
- (无)
- 递交数
- 75
- 已通过
- 36
- 上传者
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;
getline ( cin, s );
int len =s.size();
int i = 0,j = len -1;
while(j>i)
{
if ( s[j]!=s[i] )
{
cout<<"no"<<endl;
return 0;
}
i++;
j--;
}
cout<<"yes"<<endl;
return 0;
}
using namespace std;
int main()
{
string s;
getline ( cin, s );
int len =s.size();
int i = 0,j = len -1;
while(j>i)
{
if ( s[j]!=s[i] )
{
cout<<"no"<<endl;
return 0;
}
i++;
j--;
}
cout<<"yes"<<endl;
return 0;
}
#include<bits/stdc++.h> using namespace std; string s; int main(){ string a,b; cin>>s; for(int i=0;i<s.size();i++){ a+=s[i]; } for(int i=s.size()-1;i>=0;i--){ b+=s[i]; } if(a==b){ cout<<"yes"; } else cout<<"no"; return 0; }