#include #include void push(char C[], int *top, int i) { char tmp[3]; int length, j; sprintf(tmp, "%d", i); length = strlen(tmp); for (j = 0; j < length; ++j) { C[*top] = tmp[j]; ++*top; } } int main(void) { char C[102]; int D, top = 0, i; scanf("%d", &D); for (i = 1; i <= 55; ++i) push(C, &top, i); printf("%c", C[D - 1]); return 0; }