当前位置:网站首页>判断回文数
判断回文数
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";
}
边栏推荐
猜你喜欢
随机推荐
获取Ip工具类
typescript47-函数之间的类型兼容性
Redis常用命令
[Fine talk] Using native js to implement todolist
高可用 两地三中心
第四次培训
【 Harmony OS 】 【 ano UI 】 lightweight data storage
1089 狼人杀-简单版 (20 分)
Presto installation and deployment tutorial
1059 C语言竞赛 (20 分)(C语言)
web安全-PHP反序列化漏洞
typescript46-函数之间的类型兼容性
Flask的简单介绍及使用方法简介
Common fluorescent dyes to modify a variety of groups and its excitation and emission wavelength data in the data
User password encryption tool
User password verification
信息编码、存储压缩与密码学
快速上手 Mockito 单元测试框架
ss-4.1-1个eurekaServer+1个providerPayment+1个consumerOrder
Fluorescent marker peptides FITC/AMC/FAM/Rhodamine TAMRA/Cy3 / Cy5 / Cy7 - Peptide









