Here is the input file.
12345
67890
I want 123 in array1.
I want 678 in array2.

int array1[10], array2[10];
  int n, i=0;

  ifstream x;
  x.open("input.txt", ios::in)
  while( (!x.eof()) || (i<3) )
  {
    x >> n;
    array1[i] = n;
    i++;
  }
  //here should be the command for next line
  i = 0;
  while( (!x.eof()) || (i<3) )
  {
    x >> n;
    array2[i] = n;
    i++;
  }
  x.close();