C++实现整数反序输出

时间:2014-10-19 14:05:57   收藏:0   阅读:340
// 2.cpp : Defines the entry point for the console application.


// 整数反序输出

#include "stdafx.h"

#include "iostream.h"

   void main ()
   {
      int a,b,c;
      cin>>a;
      b=0;
      do{
        c=a%10; 
        a=a/10;
        b=b*10+c;
      }while(a);  //做判断

      cout<<b<<endl;

   }

 

原文:http://www.cnblogs.com/hardwork/p/4034828.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!