There is a text file containing two columns of numbers such as:
4014 4017
4014 4021
4014 4023
4014 4030
4014 4037
4014 4038
4016 4025
4017 4021
4017 4026
4017 4030
4018 4023
4018 4030
and a C++ program reading the file using this code found here
#include <iostream>
#include <fstream>
#include <list>
using namespace std;
int main() {
list<int> v_list, u_list, v_unique_sorted_list;
ifstream infile("text.txt");
int v, u;
while (infile >> v >> u)
{
v_list.insert(v_list.end(), v);
u_list.insert(u_list.end(), u);
cout << v << " " << u << endl;
}
I'm using CLion and the output on the run console is:
3880 3908
38803982 3994
3982 399
3824 3902
38243873 3943
3873 3948
3986 4033
3987 40124016 4025
4017 4021
This is part of the output. The actuall output is very big. Why is my reading scrambled??