First off, please state exactly what kind of problem you are having.
Second, your program won't execute.
check is an undefined external.
You declare check at line 6 and subsequently call it at lines 20-22, but you did not implement the function.
PLEASE USE CODE TAGS (the <> formatting button) when posting code. http://v2.cplusplus.com/articles/jEywvCM9/
It makes it easier to read your code and it also makes it easier to respond to your post.
edit: lines 20-22, you call check three times in a row checking for (), [], and {}.
The second and third calls overlay the previous result (x).
edit: You have a simliar problem inside your while loop in check. You set f1 each time through the loop ignoring the previous condition of f1.