void input() { int num, score; char name[20]; while (scanf("%d", &num) == 1 && num != 0) { scanf("%s%d", name, &score); struct stud_node *p = (struct stud_node *)malloc(sizeof(struct stud_node)); p->num = num; strcpy(p->name, name); p->score = score; p->next = NULL; if (head == NULL) { head = tail = p; } else { tail->next = p; tail = p; } } }


原文地址: https://www.cveoy.top/t/topic/cFHV 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录