题解 | #高精度整数加法#

高精度整数加法

http://www.nowcoder.com/practice/49e772ab08994a96980f9618892e55b6

const b = readline().split('');
const a = readline().split('');
let c = 0
let res='';
while( a.length || b.length || c) {
  c += ~~a.pop() + ~~b.pop()
  res = c%10 + res;
  c = c>9 ? 1 : 0;
}
console.log(res)
全部评论

相关推荐

11-28 13:56
已编辑
门头沟学院
所有好工作吻上来:最近可能压力比较大吧,面试的时候已经不屑于去说一些违心的话了,今天这场面试我真是没控制住啊,感觉我已经要发火了
实习学到最有价值的工作习...
点赞 评论 收藏
分享
11-06 23:30
已编辑
华中师范大学 后端工程师
点赞 评论 收藏
分享
评论
14
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务