visual studio has built in formatter.
Notepad ++ has one I think.
It takes about 10 min to write your own, tops. A really basic one just counts the brace pairs, destroys all leading white space on all lines, and puts it back based off the current brace count. So .. crudely
if '{' bc++ ...
and on each line
(for... x<bc << x++)
cout << ' '; //or tab, or 3 spaces, or whatever your preference is
cout << line << endl;
I had mine drop all { and } on a line with nothing else, to undo misaligned and 'textbook' format mess.