#include<iostream>
#include<math.h>
using namespace std;
int main()
{
long n,result;
int m,temp,t1,t2,i=0;
cout<<"enter n and m"<<endl;
cin>>n>>m;
temp=pow(10,m);
t1=n/temp; //高位
t2=n%temp; //低位
temp=t1;
while(temp>0)
{
temp=temp/10;
i++;
}
result=t1+t2*(pow(10,i));
cout<<result<<endl;
return 0;
}
输入一个数n和m,把低m位移到高位并输出 例123456789 3 回车后输出 789123456
最新推荐文章于 2018-04-22 13:41:00 发布