// 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; }
时间: 2024-10-09 09:39:19
// 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; }