Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 244 Bytes

hint1-2.md

File metadata and controls

21 lines (15 loc) · 244 Bytes

Use the ">>" operator to read the data from the file:

#include <iostream>
#include <fstream>
#include <iomanip>

...

int main()
{  
  ifstream input("geom.dat");

  int natom;
  input >> natom;
    
  input.close();

  return 0;
}