华为OD算法总结

输入输出处理

const r1 = require('readline').createInterface({input: process.stdin});
var iter = r1[Symbol.asyncIterator]();
const readline = async() => (await iter.next()).value;
void async function() {
    while(line = await readline()) {
        let tokens = line.split(',');
        console.log(tokens.sort().join(','));
    }
}()

输入输出处理

const r1 = require('readline').createInterface({input: process.stdin});
var iter = r1[Symbol.asyncIterator]();
const readline = async() => (await iter.next()).value;
void async function() {
    while(line = await readline()) {
        let tokens = line.split(',');
        console.log(tokens.sort().join(','));
    }
}()

输入输出处理

const r1 = require('readline').createInterface({input: process.stdin});
var iter = r1[Symbol.asyncIterator]();
const readline = async() => (await iter.next()).value;
void async function() {
    while(line = await readline()) {
        let tokens = line.split(',');
        console.log(tokens.sort().join(','));
    }
}()