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

高精度整数加法

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-07 16:07
深圳大学 运营
前端飞升:学长,阿里不是卡双非吗,我深也能去吗
点赞 评论 收藏
分享
评论
14
收藏
分享

创作者周榜

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