Chinaunix首页 | 论坛 | 博客
  • 博客访问: 380168
  • 博文数量: 83
  • 博客积分: 1650
  • 博客等级: 上尉
  • 技术积分: 861
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-18 18:22
文章分类
文章存档

2021年(1)

2016年(1)

2015年(2)

2014年(3)

2013年(12)

2012年(16)

2011年(18)

2010年(30)

分类: LINUX

2011-03-01 23:47:14

#include
#include
#include
int main(int argc, char* argv[])
{
 while(1)
 {
  unsigned int nInt = 0;
 
  cin>>nInt;
  if(0 == nInt)
   break;
  char szDigit[32];
  memset(szDigit,0,sizeof(szDigit));
  unsigned int nIntT = nInt;
 
  int nCount = 0;
  while(nIntT > 0 && nCount < sizeof(szDigit) - 1)
  {
   szDigit[nCount] = nIntT % 10;
   nIntT /= 10;
   nCount++;
  }
 
  bool bRel = true;
  for(int i = 0; i  {
   if(szDigit[i] != szDigit[nCount - i - 1])
    bRel = false;
  }
 
  if(bRel)
 
  cout<  else
  cout<
 }
 system("pause");
 return 0;
}
阅读(983) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

chinaunix网友2011-03-06 17:52:19

很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com