using any system() command in general is a bad habit, for one it is OS bound, meaning that not all OS' support it and if u try to compile it on one without it u will get an error, its also a security risk because if someone hacked your computer and changed pause.exe to something malicious you could harm your computer.
using cin.get() is not exactly like system("pause"), but it can be used to accomplish all the same tasks
also in your code, u have 'a' being a global variable but its only used in main()