1054 相邻字符判相等

来源:互联网 发布:github源码怎么运行 编辑:程序博客网 时间:2024/05/29 14:28
#include<iostream>using namespace std;int main(){char ch1,ch2;bool flag=false;ch1=getchar();while(ch1!='\n'){ch2=getchar();if(ch1==ch2){cout<<ch1<<endl;flag=true;break;}ch1=ch2;}if(flag==false)cout<<"No"<<endl;return 0;}

原创粉丝点击