The code works fine, you just have to have file.in file in your project (alongside the main.cpp) that has two numbers separated by white space