fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. // your code goes here
  5. int a = 0;
  6. int b =0;
  7. scanf ("%d",&a);
  8. printf ("千位数字:%d\n",a/ 1000);
  9. printf ("百位数字:%d\n",a%1000/100);
  10. b =a%1000/100;
  11. printf ("十位数字:%d\n",b /10);
  12. printf ("各位数字:%d\n",a%10);
  13.  
  14.  
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5328KB
stdin
1553
stdout
千位数字:1
百位数字:5
十位数字:0
各位数字:3