更新时间:2018-11-22 15:22作者:李一老师
}
tail = old;
}
if (head != NULL) {
tail->next = head;
}
return newhead;
}
int main(void)
{
int i, n, k, data;
node *head, *newhead;
while (scanf("%d %d", &n, &k) != EOF) {
for (i = 0, head = NULL; i < n; i ++) {
scanf("%d", &data);
createList(&head, data);
}
printLink(head);
newhead = reverseK(head, k);
printLink(newhead);
}
return 0;
}