<awangdev>Number of Digit One_1.java
public int countDigitOne(int n) {
        int count = 0;
        for (long i = 1; i <= n; i *= 10) {
            count += (n / i + 8) / 10 * i;
            if (n / i % 10 == 1) {
                count += n % i + 1;
            }
        }
        return count;
    }
public int sample_funcname ( int var_0 ) {
  int var_2 = 0 ;
  for ( long var_4 = 1 ;
  var_4 <= var_0 ;
  var_4 *= 10 ) {
    var_2 += ( var_0 / var_4 + 8 ) / 10 * var_4 ;
    if ( var_0 / var_4 % 10 == 1 ) {
      var_2 += var_0 % var_4 + 1 ;
    }
  }
  return var_2 ;
}
