if for example the user inputs a letter at first instead of a number, my program farts. I don't know how to control user input yet.
You are solving a specific problem. You should only train your brain/learn some ways of solving specific problem. Your program shouldn't be The Best Program In The World; it just should do its job.
However, if you really do want to reuse this code later - your problem is that you take int as an input:
1 2 3
cin >> x;
This way, if someone write text string - program will break. If you want to fix it, I suggest using sstream, although I think this is really unnecessary here, as we want program to work fast and we know what input should be.
PS. Oh, and one thing: Try to avoid system("PAUSE");