saving~
saving~
全部文章
分类
题解(49)
归档
标签
去牛客网
登录
/
注册
saving~的博客
全部文章
(共47篇)
题解 | #统计字符#
let str; while(str = readline()){ let yw = str.match(/[a-z]/gi)?str.match(/[a-z]/gi).length:0; let kg = str.match(/\s+?/gi)?str.match(/\s+?/gi).le...
Javascript V8
2021-09-28
0
448
题解 | #表示数字#
let str; while(str = readline()){ let res = str.replace(/(\d+)/g,function(v0,v1){ return '*'+v1+'*' }) console.log(res) }
Javascript V8
2021-09-28
0
441
题解 | #找出字符串中第一个只出现一次的字符#
let str; while(str = readline()){ let res = -1; for(let i=0;i<str.length;i++){ let reg = new RegExp(`${str[i]}`,'g'); if(str.match(reg)...
Javascript V8
2021-09-27
3
629
题解 | #字符逆序#
let str = readline(); function getStr(str){ let res; let returnStr; let resArr = []; if(/[^a-zA-Z\s]/g.test(str)){ throw new E...
Javascript V8
2021-09-27
0
446
题解 | #等差数列#
let str; // 值为index*3-1 while(str = parseInt(readline())){ let sum = 0; for(let i = 1;i<=str;i++){ sum += i*3-1 } console.log(sum) }
Javascript V8
2021-09-27
0
369
题解 | #记负均正#
let str; while(str = parseInt(readline())){ let lessZefo = 0,aver=0; let num = readline(); let arr = num.split(' ') for(let v of arr){ if(...
Javascript V8
2021-09-27
0
422
题解 | #求最大连续bit数#
let str ; while(str = readline()){ let w = parseInt(str).toString(2); let res = w.match(/1+/g); let num = Math.max(...res); console.log((num+...
Javascript V8
2021-09-27
0
367
题解 | #统计大写字母个数#
let str ; while(str = readline()){ //+? 禁止贪婪 let res = str.match(/[A-Z]+?/g); if(res){ console.log(res.length) }else{ console.log(0) ...
Javascript V8
2021-09-27
0
440
题解 | #尼科彻斯定理#
let str; //规律:最后一个数为:num的平方+num-1,第一个数为:num的平方-num-1 // 1:1-0 // 2:4-1 // 3:9-2 // 4:16-3 // 5:25-4 // 6:36-5 while(str = parseInt(readline())){ let...
Javascript V8
2021-09-27
1
448
题解 | #单词倒排#
let str = readline(); function getStr(str){ let res; let returnStr; let resArr = []; let reg = /([a-zA-Z]+)/g; returnStr = str.ma...
Javascript V8
2021-09-26
0
461
首页
上一页
1
2
3
4
5
下一页
末页