大佬看看
查看原帖
大佬看看
1017720
chy0817楼主2024/3/20 21:16
#include<bits/stdc++.h>
using namespace std;
int main(){
	char ch,letter[101];
	cout<<"Input a string:";
	cin>>ch;	
	int i=0,j=1;
	while(ch!='.'){
	++i;
	letter[i]=ch;
	cin>>ch;
	}
	while((j<i)&&(letter[j]==letter[i])){
		--i;++j;
	}
	if(j>=i)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0; 
}
2024/3/20 21:16
加载中...