学习时间:
2023年3月7日
题目描述:


题解分享:
// 作 者 : 繁 华 倾 夏
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h> // 调用malloc函数
//Definition for singly-linked list. // 单向链表的定义
struct ListNode {
int val;
struct ListNode* next;
};
// l1:链表 l2:链表
struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) {
struct ListNode* head = NULL, * tail = NULL; // 定义两个指针指向头和尾
int carry = 0; // 进位值
while (l1 || l2) {

最低0.47元/天 解锁文章
3674

被折叠的 条评论
为什么被折叠?



