当前位置:网站首页>判断回文数
判断回文数
2022-08-03 05:10:00 【-JMY-】
题目描述
如果一个数等于自己的逆序数。
一般我们把这种数叫回文数。例如12321和25052.
编写程序,当给出的数是回文数是,输出yes 否则输出 no
输入
只有一行,一个整数(不超过10位)
输出
yes 或者 no
样例输入
12321
样例输出
yes
参考代码:
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,nn,s=0;
cin>>n;
nn=n;
while(nn!=0){
s=s*10+nn%10;
nn/=10;
}
if(n==s)
cout<<"yes";
else
cout<<"no";
}
边栏推荐
- NotImplementedError: file structure not yet supported
- 第四次培训
- 背压机制
- shell script loop statement
- 内部类、static关键字、final
- 快速上手 Mockito 单元测试框架
- [Harmony OS] [ARK UI] ETS context basic operations
- Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG
- 详解Nurbs曲线
- 对角矩阵(diagonal matrix)
猜你喜欢

【转】最小描述长度准则MDL(Minimun Description Length)

Power button 561. An array of split

Pr第三次培训笔记

FileZilla 搭建ftp服务器

Djiango第四次培训笔记

Peptides mediated PEG DSPE of phospholipids, targeted functional materials - PEG - RGD/TAT/NGR/APRPG

Common lipophilic cell membrane dyes DiO, Dil, DiR, Did spectrograms and experimental procedures

快速上手 Mockito 单元测试框架

typescript42-readonly修饰符

Build your own web page on raspberry pie (1)
随机推荐
CAD有生僻字如何打出来、如何提交软件相关问题或建议?
Interface Test Framework Practice | Process Encapsulation and Test Case Design Based on Encrypted Interface
-查找数-
MOSN 反向通道详解
获取Ip工具类
如何不耍流氓的做运维之-SHELL脚本
Secondary development of WinForm controls
Kaggle(四)Scikit-learn
1069 微博转发抽奖 (20 分)(C语言)
阿里云对象存储oss私有桶生成链接
曲线特征----曲线弯曲程度的探究
Lambda表达式案例
在树莓派上搭建属于自己的网页(2)
flask 面试题 问题
0.ROS常用命令
Pr第四次培训笔记
快速上手 Mockito 单元测试框架
背压机制
用scikit-learn学习谱聚类
ss-4.1-1个eurekaServer+1个providerPayment+1个consumerOrder