This commit is contained in:
chefyuan 2021-04-07 20:01:23 +08:00
parent 412db7a7d8
commit 475db0e123

View File

@ -86,7 +86,7 @@ class Solution {
int sum = l1num+l2num+summod; int sum = l1num+l2num+summod;
//更新进位值例18/10=19/10=0 //更新进位值例18/10=19/10=0
summod = sum/10; summod = sum/10;
//新节点保存的值18%8=8则添加8 //新节点保存的值18 % 8=2则添加2
sum = sum%10; sum = sum%10;
//添加节点 //添加节点
tempnode.next = new ListNode(sum); tempnode.next = new ListNode(sum);