bool is_digit(char ch) { return ch >= '0' && ch <= '9'; }