3 ms·
It's only 2 lines even restricting yourself to the standard library #include <fstream> #include <iterator> #include <numeric> using namespace s
by nly 12y ago
It's only 2 lines even restricting yourself to the standard library
#include <fstream>
#include <iterator>
#include <numeric>
using namespace std;
int main() {
ifstream nf ("numbers.txt");
return accumulate (istream_iterator<int>(nf), istream_iterator<int>(), 0);
}