当前位置:网站首页>判断回文数
判断回文数
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";
}
边栏推荐
猜你喜欢
Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)
Shell conditional statement judgment
【Biotin Azide|cas:908007-17-0】Price_Manufacturer
Kaggle 入门(Kaggle网站使用及项目复现)
曲线特征----曲线弯曲程度的探究
typescript44-对象之间的类兼容器
集合框架知识
Build your own web page on raspberry pie (1)
网络流媒体下载的 10 种方法(以下载 Echo 音乐为例)
idea使用@Autowired注解爆红原因及解决方法
随机推荐
Benchmark 第一篇 了解Benchmark
FileZilla 搭建ftp服务器
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
2. 两数相加
Modelarts第一次培训
flask 面试题 问题
odps的临时查询能在写sql的时候就给结果一个命名不?
VR全景展打造专属元宇宙观展空间
接口和抽象
背压机制
The problem that the rosbag tool plotjuggler cannot open rosbag
Response 重写设置返回值
快速上手 Mockito 单元测试框架
VSO Downloader Ultimate 5.0.1.45 中文多语免费版 在线视频下载工具
高效率科研神器——小软件、大能量
用户密码验证
ss-1.curl (cloud-provider-payment8001)
数据分析 第一篇
【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed
1054 求平均值 (20 分)