how to make the output not repeated

i want to cout the elements on the array subjs[] which are repeated more than (n)this code has something wrong as it repeats the outputs how to stop repeating them . and only using <iostream> <strings> allowed.
example
output w
hich i see for example:
jamie
sandy
john
sandy
sandy

output i need:
jamie
sandy
john

1
2
3
4
5
6
7
8
9

  cin>>n;
	for(int i=0;i<cc3a;i++){
 counter55=1;
			for(int j=i+1;j<cc3a;j++){
				if(subjs[i]==subjs[j]){
					counter55++;
					if(counter55>n){cout<<subjs[i]<<endl;
                                                     }
Last edited on
closed account (48T7M4Gy)
start at index of first name
loop:
select name at index
check if name is previously listed
if it is not found
print name

increment index
loop back
Topic archived. No new replies allowed.