yuuhhh @ 2022-10-13 00:47:38
#include<stdio.h>
int main()
{int n,m;
scanf("%d",&n);
int mask=1;
int t=n;
while(n>9)
{n/=10;
mask*=10;
}
int cnt=0;
while(t>0)
{m=t%10;
cnt=cnt+m*mask;
mask/=10;
t/=10; }
if(cnt>0)
printf("%d",cnt);
else printf("-%d",cnt);
return 0;
}
by ud2_ @ 2022-10-13 01:16:49
N 不一定是正整数。
by lyx090702 @ 2022-10-13 16:25:16
n还有负数呢