#include <iostream>
using namespace std;

int cal1From0ToN(int n) {
	int pow1 = 1;
	int pow2 = 10;
	int count = 0;
	while (n / pow1) {
		switch (n % pow2 / pow1) {
		case 0:
			count += n / pow2 * pow1;
			break;
		case 1:
			count += n / pow2 * pow1;
			count += n % pow1 + 1;
			break;
		default:
			count += (n / pow2 + 1) * pow1;
		}
		pow1 *= 10;
		pow2 *= 10;
	}
	return count;
}
05-11 04:05