头像

番茄酱

njupt => seu




离线:17分钟前


最近来访(529)
用户头像
可导一定连续
用户头像
Jun不见
用户头像
夜深人未静
用户头像
Sky_
用户头像
carryking
用户头像
卿临
用户头像
wKingYu
用户头像
_wyp_
用户头像
Cabin-65--
用户头像
陌丨落
用户头像
这道题有点难耶
用户头像
我再吃一口
用户头像
OI
用户头像
嗨呀不是我
用户头像
csdoge
用户头像
ZXG_DXX
用户头像
GhostMFC
用户头像
hx00
用户头像
可乐土豆
用户头像
南笙离梦

新鲜事 原文

番茄酱
2个月前
毕业咯


活动打卡代码 AcWing 743. 数组中的行

番茄酱
2个月前
let buf = '';

process.stdin.on('readable',() => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let lines = buf.split('\n');
    let L = parseInt(lines[0]);
    let S = lines[1];
    let g = [];
    for (let i = 0; i < 12; i++) {
        g.push(lines[i + 2].split(' ').map(x => {
            return parseFloat(x);
        }));
    }
    let sum = 0;
    for (let i = 0; i < 12; i++) {
        sum += g[L][i];
    }
    if (S === 'M') sum /= 12;
    console.log(sum.toFixed(1));
});


活动打卡代码 AcWing 737. 数组替换

番茄酱
2个月前
let buf = '';

process.stdin.on('readable',() => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let X = buf.split('\n').map(x => {
        return parseInt(x);
    });
    for (let i = 0; i < 10; i++) {
        X[i] = Math.max(X[i], 1);
        console.log(`X[${i}] = ${X[i]}`);
    }
});


活动打卡代码 AcWing 665. 倍数

番茄酱
2个月前
let buf = '';

process.stdin.on('readable',() => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let [a, b] = buf.split(' ').map(x => {
        return parseInt(x);
    });
    if (a % b === 0 || b % a === 0) {
        console.log('Sao Multiplos');
    } else {
        console.log('Nao sao Multiplos');
    }
});


活动打卡代码 AcWing 654. 时间转换

番茄酱
2个月前
let buf = '';

process.stdin.on('readable',() => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let n = parseInt(buf);
    let h = parseInt(n / 3600);
    n %= 3600;
    let m = parseInt(n / 60);
    n %= 60;
    let s = n;
    console.log(`${h}:${m}:${s}`);
});


活动打卡代码 AcWing 653. 钞票

番茄酱
2个月前
let buf = '';

process.stdin.on('readable',() => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let n = parseInt(buf);
    let money = [100, 50, 20, 10, 5, 2, 1];
    console.log(n);
    money.forEach(p => {
        let cnt = parseInt(n / p);
        n %= p;
        console.log(`${cnt} nota(s) de R$ ${p},00`);
    });
})


活动打卡代码 AcWing 616. 两点间的距离

番茄酱
2个月前
let buf = '';

process.stdin.on('readable', () => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
    let lines = buf.split('\n');
    let [x1, y1] = lines[0].split(' ').map(x => {
        return parseFloat(x);
    });
    let [x2, y2] = lines[1].split(' ').map(x => {
        return parseFloat(x);
    });
    let dx = x1 - x2;
    let dy = y1 - y2;
    console.log(Math.sqrt(dx * dx + dy * dy).toFixed(4));
});


活动打卡代码 AcWing 608. 差

番茄酱
2个月前
let buf = '';

process.stdin.on('readable', () => {
   let chunk = process.stdin.read();
   if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
   let [a, b, c, d] = buf.split('\n').map(x => {
       return parseInt(x);
   }); 
   console.log('DIFERENCA = ' + (a * b - c * d));
});


活动打卡代码 AcWing 1. A + B

番茄酱
2个月前
let buf = '';

process.stdin.on('readable', () => {
    let chunk = process.stdin.read();
    if (chunk) buf += chunk.toString();
});

process.stdin.on('end', () => {
   let [a, b] = buf.split(' ').map((x) => {
       return parseInt(x);
   }); 
   console.log(a + b);
});


新鲜事 原文

番茄酱
2个月前
AcWing《Web应用课》拼团优惠!https://www.acwing.com/activity/content/introduction/1150/group_buy/71226/ 2缺1啊