mirror of
https://github.com/wczffl-503/OI-Codes.git
synced 2025-07-08 02:13:51 +08:00
添加了许多代码文件
This commit is contained in:
27
#278. 小码君的回文字符串.cpp
Normal file
27
#278. 小码君的回文字符串.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
#include <iostream>
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
#include <iomanip>
|
||||
using namespace std;
|
||||
int main(){
|
||||
char a[10000];
|
||||
cin >>a;
|
||||
int b;
|
||||
int flag=1;
|
||||
for(int i=strlen(a)-1;i>=0;i--){
|
||||
b=strlen(a)-i-1;
|
||||
if(a[i]!=a[b]){
|
||||
flag=0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(flag==1){
|
||||
cout <<"Yes";
|
||||
}
|
||||
else{
|
||||
cout <<"No";
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user