```
struct ListNode* addTwoNumbers(struct ListNode* l1, struct ListNode* l2) {
struct ListNode* res, *L1=l1, *L2=l2, *temp;
while (L1&&L2) {
L1->val=L2->val=L1->val+L2->val;
L1 = L1->next;
L2 = L2->next;
}
res = (L1) ? l1 : l2;
temp=res;
while (temp) {
if (temp->val>=10) {
if (!temp->next) temp->next = (struct ListNode*)calloc(1,sizeof(struct ListNode));
temp->val-=10;
temp->next->val+=1;
}
temp = temp->next;
}
return res;
```

}