int n,y;
cout<<"Enter the number:";
cin>>n;//n保存输入的整数
cout<<"The number in reverse order is";
while(n!=0)
{
y=n%10;//对n求模取出当前个位数
cout<<y;
n=n/10;//即n=n/10运算,相当于对n右移一位,去掉已取出的个位数
}
【C++】整数拆分程序框架
猜你喜欢
转载自blog.csdn.net/weixin_44825297/article/details/104961987
今日推荐
周排行