第11周项目6(2)-回文素数
来源:互联网 发布:网络布线 编辑:程序博客网 时间:2024/05/22 05:10
/* *Copyright (c) 2014, 烟台大学计算机学院 *All rights reserved. *文件名称:week11-project6-2.cpp *作者:高赞 *完成日期:2014年 11 月 7 日 *版本号:v1.0 * *问题描述:判断参数是否为回文数 */#include <iostream>#include <cstdio>using namespace std;bool isPalindrome(int);int main(){ char ch; do { int m; cin>>m; if(isPalindrome(m)) cout<<m<<"是回文数,噢耶!"<<endl; else cout<<m<<"不是回文数。回文有什么好!"<<endl; cout<<"N键退出其他键继续..."<<endl; cin >> ch; } while (ch!='n' && ch!='N'); return 0;}bool isPalindrome(int x){ bool huiwen; int X=x,y,z=0; while (x>0) { y=x%10; z=z*10+y; x=x/10; } if (X==z) huiwen=true; else huiwen=false; return(huiwen);}
运算结果:
0 0
- 第11周项目6-回文、素数-回文素数
- 第11周项目6-回文,素数
- 第11周项目6-回文、素数
- 第11周项目6:回文,素数
- 第11周项目6-回文素数
- 第11周项目6-回文、素数 回文数
- 第11周项目6-回文、素数-回文数
- 第11周项目6(2)-回文素数
- 第11周项目6(4-2)-回文素数
- 第11周 项目6-回文.素数(2)
- 第11周项目6-回文、素数(2)
- 第11周项目6(2)-回文、素数
- 第11周项目6-回文、素数 素数
- 第11周项目6-回文、素数-可逆素数
- 第11周项目6-回文、素数-素数
- 第11周项目3:回文,素数
- 第11周项目 回文素数
- 第11周项目6-素数、回文-回文素数 改1
- 栈的实现
- DIV的常用属性
- [MYSQL]时间毫秒数转换
- 安装ESB MQ 缺少/lib/ld-linux.so.2 解决办法
- JAVA连接SQL2005
- 第11周项目6(2)-回文素数
- 第11周项目2-求两个数的最大公约数
- 动态内存分配
- HDOJ1017
- ExpandListView onChildClickListener 失效
- Rendering Problems Exception raised during rendering: java.lang.System.array 的解决办法
- Spring配置
- 第十一周项目二求最大公约数(3)
- elastic