首页 > 其他 > 详细

#2019120700021 回文判断

时间:2019-12-07 10:16:39      阅读:71      评论:0      收藏:0      [点我收藏+]
#include <cstdio>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream> 
using namespace std;
char ch,lett[101];
int main(){
    scanf("%s",lett+1);
    int a=1,b=strlen(lett+1);
    b--;
    while(lett[a]==lett[b]&&(b>=1)) {
        a++;b--;
    }
    if(b==0) printf("Yes");
    else printf("No");
    return 0; 
     
}
void fetc(){
    int i=1;
    cin>>ch;
    while(ch!='.'){
        lett[i]=ch;
        i++;
        cin>>ch;
    }
    return ;
}

\(fetc\)函数是一种读入字符串的方式

#2019120700021 回文判断

原文:https://www.cnblogs.com/liuziwen0224/p/12000536.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!