I have my program all written out and I'm pretty sure it works. I think that I have some syntax error that I just can't see, because it will compile, but it closes when it should get to my if statement.
#include <iostream>
#include <cmath>
using namespace std;
There is no syntax error, the program is simply not doing what you probably intended. Inside the infinite loop, the first thing you do is set subsubtotal to -1. The if statement is only entered when subtotal is 0, which means that subsubtotal+=subtotal must have left the value of subsubtotal unchanged. So, you add 1 to subtotal, making it equal to 0, meaning that every time the first if statement is entered the second one will be entered as well. The code breaks, and it appears to the operator that the program erroneously closed.