1
Imagine the alphabet, in this alphabet there are words from A-Z, but suddenly there are several letters A, like:
To-B-C-D-E-F-G-H-I-To-J-K-L-To-M-To-N-O-P-Q-To
The variable nomes
below, is this alphabet. The variable procurar
will only serve for me to choose which word repeated I want to see in the variable nomes
.
In this model:
string procurar = "cachorro";
string nomes = "vaca cachorro vaca cachorro gato cavalo";
int index = ??
int total = ??
Anyone can help?
But count all the repeated words or just the word that is in the variable
procurar
?– Isac
count the words that are in the variable
nomes
. The variableprocurar
serves to find the repeated name in the variablenomes
.– sYsTeM