#include<iostream>
#define s 1000
#include<math.h>
using namespace std;
int main()
{
long long i=0,n,m,a[s],j,k;
cin>>n;
k=fabs(n);
while(k!=0)
{
m=k%10;
k=k/10;
i++;
a[i]=m;
}
if(n<0)
{
cout<<'-';
for(j=1;j<=i;j++)
{
if(a[1]==0)
{
for(j=2;j<=i;j++)
cout<<a[j];
}
else
{
cout<<a[j];
}
}
}
else if(a[1]==0)
{
for(j=2;j<=i;j++)
cout<<a[j];
}
else
{
for(j=1;j<=i;j++)
cout<<a[j];
}
return 0;
}
倒叙输出位数
猜你喜欢
转载自blog.csdn.net/aaassslll147/article/details/81433316
今日推荐
周排行