Lecture du fichier dans try
This commit is contained in:
parent
1076fa6034
commit
183df528f1
1 changed files with 2 additions and 2 deletions
|
@ -1,8 +1,8 @@
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const file = fs.readFileSync("input", "utf8");
|
|
||||||
const data = JSON.parse(file);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
const file = fs.readFileSync("input", "utf8");
|
||||||
|
const data = JSON.parse(file);
|
||||||
console.log("Traitement de la première partie…");
|
console.log("Traitement de la première partie…");
|
||||||
console.log("La somme totale est " + parseJsonPrem(data));
|
console.log("La somme totale est " + parseJsonPrem(data));
|
||||||
} catch(err) {
|
} catch(err) {
|
||||||
|
|
Loading…
Reference in a new issue