fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a;
  5. printf("请输入一个三位数:");
  6. scanf("%d", &a);
  7.  
  8. // 先去掉个位,再对10取余
  9. int shi = (a / 10) % 10;
  10.  
  11. printf("十位数是:%d\n", shi);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0s 5324KB
stdin
Standard input is empty
stdout
请输入一个三位数:十位数是:6