首页
DreamJudge
院校信息
考研初试
机试真题
讨论区
兑换中心
登录
注册
上岸
以下题解仅供学习参考使用。
抄袭、复制题解,以达到刷AC率/AC数量或其他目的的行为,在N诺是严格禁止的。
N诺非常重视学术诚信。此类行为将会导致您成为作弊者。具体细则请查看N诺社区规则。
阿灿
2025年3月15日 21:36
回文数 题解:string一下完了
P1712
回复 0
|
赞 1
|
浏览 377
#include<bits/stdc++.h> using namespace std; int main(){ string k1,k2; int n; while(cin>>k1){ k2.clear(); n=k1.length(); for(int i=n-1;i>=0;i--){ k2.push_back(k1[i]); } if(k1==k2){ cout<<"true"<<endl; }else{ cout<<"false"<...
小王桐学
2024年2月6日 21:35
回文数 题解:C
P1712
回复 0
|
赞 1
|
浏览 783
#include <stdio.h> //判断回文 int Palindrome(int n) { int a[100],i = 0,j; while(n) { a[i++] = n%10; n/=10; } j = 0; i--; while(j <= i && a[i] == a[j]) i--,j++; if(j > i) return 1; else return 0; } int main() { int n,i = 0,j,a[1000]; while(sc...
fanxi
2020年5月9日 17:16
为什么只能用scanf而用gets出错?
P1712
回复 2
|
赞 1
|
浏览 8.9k
#include <stdio.h> #include <string.h> int main() { char s[10000]; while(scanf("%s",s)!=EOF)//必须使用scanf才能AC,gets不行 { getchar(); int n=strlen(s); ...
fanxi
2020年5月9日 17:22
两种方法
P1712
回复 0
|
赞 0
|
浏览 8.7k
////方法1:字符串双指针方法 /* #include <stdio.h> #include <string.h> int main() { char s[10000]; while(scanf("%s",s)!=EOF)//必须使用scanf才能AC,gets不行 { getchar(); int n=strlen(s); ...
题目
回文数
题解数量
4
发布题解
在线答疑
热门题解
1
回文数 题解:string一下完了
2
为什么只能用scanf而用gets出错?
3
回文数 题解:C
4
两种方法