热门

最新

红包

立Flag

投票

同城

我的

发布
debughe
HeYuxiaoxxx
6 年前
truedebughe

我的第一篇原创!

我用Python爬取了难下载的电子教材(内附代码)

CSDN App 扫码分享
分享
评论
点赞
打赏
  • 复制链接
  • 举报
下一条:
为什么输入数字会输出true啊,求解。#include <iostream>#include <string.h>#include <stdio.h>using namespace std;int testPalindrome(char *p){ char *p1=p,*p2; p2=p+strlen(p)-1; while(p1<p2) { if(*(p1++)!=*(p2--)) return 0; else return 1; }}int main(){ int T; char p[100]; cin>>T; for(int i=0;i<T;i++) { gets(p); if(testPalindrome(p)) { cout<<"true"<<endl; } else cout<<"false"<<endl; } return 0;}
立即登录