For this you can use the node.js filesystem api (also write your code in node.js – it’s on google v8 so it should be fast enough for this one)
EDIT
I thought about your problem and it can be more simply solved (without using node.js) making a AJAX request to the file. You can achieve this like so :
var xmlhttp;
if (window.XMLHttpRequest)
{ // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
}
else
{ // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
// This logs the input.txt contents in the console.
// You can do whatever you want with it
console.log(xmlhttp.responseText);
}
}
xmlhttp.open("GET","input.txt",true);
xmlhttp.send();
}
If you are a beginner you can read more stuff about AJAX requests on W3Schools
You can choose the method that suites better for you! Good luck!
3
solved Input in the facebook hacker cup [closed]