回复 8楼 ClearningC
是不是这样:#include<stdio.h>
int _inverse(int n, int *len)
{
int m=0, a;
*len = 0;
while(n > 0)
{
a = n % 10;
m = m * 10 + a;
n = n / 10;
*len += 1;
}
return m;
}
main()
{
int i, n, a, b, len=0;
scanf("%d", &n);
for(i=0; i<n; i++)
{
scanf("%d%d", &a,&b);
a = _inverse(a, &len);
printf("%0*d %d\n", len, a, a%b);
}
}