题解 | 整数的十位
整数的十位
https://www.nowcoder.com/practice/031db23916904f4fad72198fe491b47b
#include <math.h>
#include <stdio.h>
int mod(int a)
{
int c,b = 0;
b = a/10;
c = b - 10*(b/10);//重点在于这里的去除更高位的数字,放缩后的b可以去除高位
return c;
}
int main() {
int a;
scanf("%d",&a);
int c = mod(a);
printf("%d",c);
return 0;
}