Amanda-Zhang
追梦女一枚

牛客常见的输入输出

2021-03-12 -leetcode -算法
Word count: 64 | Reading time: 1min

1.输入两个数,输出他两个的和

javascript (V8 6.0.0)

1
2
3
4
5
6
var line;
while(line = readline()){
//读取出来的是字符串格式
line = line.split(' ')
print(parseInt(line[0]) + parseInt(line[1]))
}
1
2
3
4
while(line=readline()){
let [a,b]=line.split(' ')
console.log(parseInt(a)+parseInt(b))
}

Node

1
2


Author: Amanda-Zhang

Link: http://chunchunya.github.io/2021/03/12/3_12%20%E7%89%9B%E5%AE%A2%E5%B8%B8%E8%A7%81%E8%BE%93%E5%85%A5%E8%BE%93%E5%87%BA/

Copyright: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.

< PreviousPost
Js中的Set和Map
NextPost >
力扣每日一题-两个栈模拟队列
CATALOG