当前位置:网站首页>判断回文数
判断回文数
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";
}
边栏推荐
- 快速上手 Mockito 单元测试框架
- Djiango第四次培训笔记
- 3n+1问题
- Build your own web page on the Raspberry Pi (2)
- Installation of Apache DolphinScheduler version 2.0.5 distributed cluster
- [Fine talk] Using native js to implement todolist
- [Harmony OS] [ARK UI] ETS context basic operations
- minio下载文件乱码或者是一条横线
- 对角矩阵(diagonal matrix)
- typescript41-class类的私有修饰符
猜你喜欢
随机推荐
[Fine talk] Using native js to implement todolist
建造者模式(Builder Pattern)
idea uses @Autowired annotation to explain the reasons and solutions
4.如何避免缓存穿透、缓存击穿、缓存雪崩
High availability, two locations and three centers
Exception(异常) 和 Error(错误)区别解析
Gradle的安装配置
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
Interface Test Framework Practice | Process Encapsulation and Test Case Design Based on Encrypted Interface
BIOTIN ALKYNE CAS: 773888-45-2 Price, Supplier
vim命令
Modified BiotinDIAZO-Biotin-PEG3-DBCO|diazo-biotin-tripolyethylene glycol-diphenylcyclooctyne
Shell conditional statement judgment
web安全-SSTI模板注入漏洞
生活原则。
presto安装部署教程
Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8
Redis常用命令
设计模式——组合模式、享元模式(Integer缓存)(结构型模式)
ss-4.1-1个eurekaServer+1个providerPayment+1个consumerOrder








