// 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; }
// 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; }
转载于:https://www.cnblogs.com/hardwork/p/4034828.html