19.8.19流利说前端笔试题

一个字符串(每个字符不同)有多少子集
双向链表
编程

// 开方,保留四位小数
process.stdin.setEncoding('utf8');
process.stdin.on('data', (input) => {
input = input.toString().trim();
let res=Math.sqrt(input);
res=res+''
let arr=res.split('.')
let f;
// console.log(arr)
if(arr.length>1){
if(arr[1].length>4)
f=arr[0]+'.'+arr[1].substring(0,4)
else{
f=arr[0]+'.'+arr[1]
}
}else{
f=arr[0]
}
console.log(f)
})
问答:
1.
2.web安全和防范
#笔试题目##流利说#
全部评论
其实我觉得第一个编程题应该是不让使用sqrt 但是我还是用了😂
点赞 回复 分享
发布于 2019-08-20 11:24
编程题答案三行代码AC。。
点赞 回复 分享
发布于 2019-08-20 11:26
const { Transform } = require('stream'); const sqrt = new Transform({     transform(chunk, encoding, callback) {         this.push(Math.sqrt(chunk).toFixed(4));         callback();     }, }); process.stdin.pipe(sqrt).pipe(process.stdout);
点赞 回复 分享
发布于 2019-08-20 12:24
请问收到面试消息了吗。。这么久了还没消息是凉了么。。
点赞 回复 分享
发布于 2019-08-31 17:45

相关推荐

MingoTree:看不出你你的技术栈,想找什么工作,然后课设项目别写上去了,自我评价删了,前后端你想好你要干啥,这种简历投上去秒挂的
点赞 评论 收藏
分享
评论
点赞
1
分享

创作者周榜

更多
牛客网
牛客企业服务