0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-10 15:18:48 +00:00
OI-codes/LibreOJ/4/data/spj_nodejs.js

20 lines
616 B
JavaScript
Raw Normal View History

2022-05-28 12:25:28 +00:00
exports.main = () => {
code = code.trim().split('\r\n').join('\n');
let outputCode = user_out.trim().split('\r\n').join('\n');
if (code.length >= 10 && code === outputCode) exit({ score: 100 });
else exit({ score: 0 });
}
function exit(obj) {
process.stdout.write(String(obj.score));
if (obj.message) process.stderr.write(String(obj.message));
process.exit();
}
let fs = require('fs');
let input = fs.readFileSync('input').toString();
let user_out = fs.readFileSync('user_out').toString();
let answer = fs.readFileSync('answer').toString();
let code = fs.readFileSync('code').toString();
exports.main();