梦游神


私信TA

用户名:2214999

访问量:5024

签 名:

等  级
排  名 355
经  验 5107
参赛次数 3
文章发表 34
年  龄 0
在职情况 学生
学  校 山东
专  业

  自我简介:

TA的其他文章

 

参考代码:

#include"bits/stdc++.h"
using namespace std;
char str[280];
bool check(char *s,int a,int b){
	while(a!=b&&s[a]==s[b]){
		a++;
		b--;
	}
	//abccba
	if(a>=b)
	return true;
	else
	return false;
} 
int main(){
	cin>>str;
	if(check(str,0,strlen(str)-1))
	cout<<"Y";
	else
	cout<<"N";
	
	return 0;
}


 

0.0分

0 人评分

  评论区