Skip to content

Instantly share code, notes, and snippets.

@stuymedova
Last active January 29, 2023 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stuymedova/caad208fa0e71a18209487c0b281f1a9 to your computer and use it in GitHub Desktop.
Save stuymedova/caad208fa0e71a18209487c0b281f1a9 to your computer and use it in GitHub Desktop.
// Node.js
const fs = require('fs');
const sum = (a, b) => {
return Number(a) + Number(b);
};
const fileContent = fs.readFileSync("input.txt", "utf8");
const [a, b] = fileContent.toString().split(' ');
const result = sum(a, b);
fs.writeFileSync("output.txt", result.toString());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment