首页 > 编程语言 > 详细

C++实现整数反序输出

时间:2014-10-19 14:05:57      阅读:340      评论:0      收藏:0      [点我收藏+]
// 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;

   }

 

C++实现整数反序输出

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!