fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int a;
  5. printf("请输入一个三位数:");
  6. scanf("%d", &a);
  7.  
  8. // 百位数 = 除以 100 取整
  9. int bai = a / 100;
  10.  
  11. printf("百位数是:%d\n", bai);
  12. return 0;
  13. }
  14.  
Success #stdin #stdout 0.01s 5308KB
stdin
Standard input is empty
stdout
请输入一个三位数:百位数是:327