3
#include <iostream>
#include <string.h>
using namespace std;
int main() {
int condicao;
cin >> condicao; //Determina o tamanho do vetor //
while(condicao != 0){
char nome[100];
for(int iniciar = 0;iniciar < condicao;iniciar++){
cin >> nome[iniciar];
}
for (int i = condicao - 1; i >= 0; i--) {
cout << nome[i];
}
cout << endl;
cin >> condicao;
}
return 0;
}
What is your doubt?
– Maniero
How do I clean Vector, since when typing a new chain of charters the previously written string remained. For example, I type the string "avocado" and the return is "etacaba". Resuming, when I insert a chain, called "house", the return is etaasac, that is, there is the permanence of the previous chain, being noticed by the three last charters.
– J.D.Salinger
You want to read 100 strings, is that it? Or you want to read a string with 100 characters?
– Maniero
We’re talking about your code, if you don’t even know what he has to do.
– Maniero
It will print the string, typed by the user, backwards and forwards...
– J.D.Salinger
What is this
parada
?– Maniero
It is what determines the size of the Vector.
– J.D.Salinger
100 strings with 100 charters.
– J.D.Salinger
You have to decide what you’re doing.
– Maniero