当前位置:网站首页>判断回文数
判断回文数
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";
}
边栏推荐
猜你喜欢

typescript49-交叉类型

Install IIS services (Internet Information Services (Internet Information Services, abbreviated IIS, Internet Information Services)

Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8

【HMS core】【Ads Kit】Huawei Advertising——Overseas applications are tested in China. Official advertisements cannot be displayed

Interface Test Framework Practice | Process Encapsulation and Test Case Design Based on Encrypted Interface

web安全-PHP反序列化漏洞

集合框架知识

web安全-命令执行漏洞

shell脚本循环语句

Tag stack - stack monotonically preparatory knowledge - lt. 739. The daily temperature
随机推荐
js实现一个 bind 函数
Tributyl-mercaptophosphane "tBuBrettPhos Pd(allyl)" OTf), 1798782-17-8
业务表解析-余额系统
Get the Ip tool class
数据分析 第一篇
【Harmony OS】【ARK UI】ets use startAbility or startAbilityForResult to invoke Ability
Lambda表达式案例
用scikit-learn学习谱聚类
web安全-PHP反序列化漏洞
Length n of condensed distance matrix ‘y‘ must be a binomial coefficient
1. 两数之和
Coordinate knowledge in digital twin campus scenarios
UV decomposition of biotin - PEG2 - azide | CAS: 1192802-98-4 biotin connectors
typescript42-readonly修饰符
斐讯K2路由编译Padavan华硕固件和心得
shell脚本循环语句
【特征选取】计算数据点曲率
2017-06-11 Padavan 完美适配newifi mini【adbyby+SS+KP ...】youku L1 /小米mini
用户密码验证
ss-2.子项目互相访问(order80 -> payment8001)