Im a beginner to C++. Its my first year in college. Im completely stuck at this.I have to make a program which takes input 4 strings then check if some value already exists if it does then output value exists and thats it, if not, if they all are unique(all 4 strings) then output them in ascending order.Code bellow works and it already outputs them in ascending order, but how to find if values repeats before writing them?
sorry for my bad English guys i hope u understand what I am trying to say here
Are you allowed to use std::set? It would make this problem very simple.
You should check for duplicates as you insert into the array. If you have to wait for the user to finish inputting before outputting the duplicates, you can make note of them separately for later.