// 递归方法 char* reverse3(char* str, int len) { if (len <= 1) return str; char t = *str; *str = *(str + len - 1); *(str + len - 1) = t; return (reverse3(str + 1, len - 2) - 1); }
List reverse3(List head) { List newHead; if(head==NULL ||head->next==NULL) { return head; } newHead = reverse3(head->next); head->next->next=head; head->next=NULL; return newHead; }
int ft_readline_p6(t_lst *****lsta, t_lst ****lstb, t_read *r, char *line) { if (ft_strcmp(line, "rrr") == 0) { if (****lsta && ft_comptelem(****lsta) > 1) reverse5(&lsta); if (***lstb && ft_comptelem(***lstb) > 1) reverse3(&lstb); return (1); } else { r->inderror = 1; return (1); } return (0); }