posts - 24,  comments - 0,  trackbacks - 0
bool symmetry(long a)
{
    
long i,temp;
    temp
=0,i=a;
    
while(i)
    {
        temp
=10*temp+i%10;
        i
=i/10;
    }
    
return (temp==a);
}
int _tmain(int argc, char* argv[])
{
    
long i=12345;
    cout
<<symmetry(i)<<endl;
    
return 0;
}
posted on 2012-09-01 21:03 qiushao 阅读(182) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理