I do not understand why are so many coders interested in time consumed by program…

I do not know if there is something faster (if judge is returning TLE, and you are using scanf, than you have bad algorithm complexity).

Your function above is reading input char by char and function wants to red int. So if you have 123, you know that this is (10*((10*1)+2)+3), in loo you will do

```
0 // initial value
0 // prepare for the first digit
1 // first digit
10 // prepare for next digit (x10)
12 // second digit (+2)
120 // prepare for next digit (x10)
123 // last digit (+3)
```

so if you understand that, the last thing you need is to convert characters to digits and you can do this by substracting ‘0’, and even if you do not know ascii values of characters, you probably agree, that ‘0’ - ‘0’ = 0, and digits are in ascii in correct order, so ‘1’ = ‘0’ + 1 => ‘1’ - ‘0’ = 1 and so on…