將各位數(shù)字反轉(zhuǎn)后輸出?
程序:
#include(iostream.h)
voidmain(void)
{intn,right_digit,newnum=0;
cout<<"Enterthenumber:";
cin>>n;
cout<<"Thenumberinreverseorderis";
do{right_digit=n%10;
cout<<right_digit;
n/=10;
}
while(n!=0);
cout<<endl;
}
將各位數(shù)字反轉(zhuǎn)后輸出?
程序:
#include(iostream.h)
voidmain(void)
{intn,right_digit,newnum=0;
cout<<"Enterthenumber:";
cin>>n;
cout<<"Thenumberinreverseorderis";
do{right_digit=n%10;
cout<<right_digit;
n/=10;
}
while(n!=0);
cout<<endl;
}