fork download
  1. #include <stdio.h>
  2. #include<math.h>
  3. int main() {
  4. int a,b,m,s,f;
  5. scanf("%d",&a);
  6. s=(int)log10(a)+1;
  7. scanf("%d",&b);
  8. f=s-b;
  9. for(int i=0;i<f;i++){
  10. a/=10;
  11. }
  12. printf("%d",(a%10));
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5304KB
stdin
98420
stdout
Standard output is empty