>>176
typedef struct tag_Station {
    char name[256];
    struct tag_Station *prev;
} Station;
int main(void) {
    Station *currents = malloc(sizeof (Station));
    Station *lasts = NULL;
    if (currents == NULL)
        return 1;
    currents->prev = NULL;
    puts("駅名入力(終了キー:/e)");
    while (1) {
        char buf[256];
        fgets(buf, sizeof(buf), stdin);
        buf[strlen(buf) - 1] = '\0';
        if (strcmp(buf, "/e") == 0)
            break;
        strcpy(currents->name, buf);
        lasts = malloc(sizeof (Station));
        if (lasts == NULL)
            break;
        lasts->prev = currents;
        currents = lasts;
    }
    while (currents->prev != NULL) {
        puts(currents->name);
        free(currents);
        currents = currents->prev;
    }
    return 0;
}