The problem is because of the cin statements.
is not the correct way of scaning two integers. Instead it fetches i only even though you have passed more of them. The rest are all stored in input buffer and will be used as values when the program expects any in future.
As mentioned above, It reads the character from the input buffer, not from the keyboard though you have entered.
Also, when you passed i & j, if you have pressed 'Enter' to terminate inputting the values, that 'Enter' is even be taken as input for cin.get(). Thats why you are not able to see the output. It is good to clear the input buffer before doing cin::get() through cin::ignore().
Hence, the corrections are..
cin >> i >> j;
cin.ignore(); // Add before calling cin.get();
||| Dharma |||