604wzc @ 2017-04-12 17:08:38
#include<stdio.h>
#include<math.h>
int main()
{
long int Get,T=1;
int Put[20],cent=0,len;
scanf("%ld",&Get);
if(Get<0)
{
printf("-");
Get=abs(Get);
}
for(;Get/T>0;T*=10,cent++);
len=cent;
cent--;
for(T=(int)(pow(10.0,(double)(cent)));T>0;T/=10,cent--)
{
Put[cent]=Get/T;
Get=Get-Get/T*T;
}
//printf("\n");
//printf("%d",cent);
for(cent=0;cent<len;cent++)
{
if(Put[cent]==0)
{
continue;
}
printf("%d",Put[cent]);
}
return 0;
}
“abs”was not declared in this scope
by SeaSun_W @ 2017-04-12 17:29:29
要调用math库(来自蒟蒻的回答)
by 604wzc @ 2017-04-13 16:20:57
可是我调用了哈
by Alien_worm @ 2017-09-21 10:19:50
再加一个stdlib.h试试