#include <iostream>
using namespace std;
#define MAX_ITENS 50 //número de itens a serem lidos se quiser modificar para testes
int main() {
int vet[MAX_ITENS];
bool repetido;
for(int i = 0; i < MAX_ITENS; i++) {
cout << ("Numero: ");
cin >> vet[i];
}
for(int i = 0; i < MAX_ITENS; i++) {
repetido = false;
for(int j = 0; j < i; j++) { //verifica se existem iguais apenas entre os anteriores
if (vet[j] == vet[i]) {
repetido = true;
break; //tem repetido, não precisa continuar com a procura
}
}
if (!repetido) {
cout << vet[i] << endl;
}
}
}
//https://pt.stackoverflow.com/q/37002/101
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwojZGVmaW5lIE1BWF9JVEVOUyA1MCAvL27Dum1lcm8gZGUgaXRlbnMgYSBzZXJlbSBsaWRvcyBzZSBxdWlzZXIgbW9kaWZpY2FyIHBhcmEgdGVzdGVzCiAKaW50IG1haW4oKSB7CiAgICBpbnQgdmV0W01BWF9JVEVOU107CiAgICBib29sIHJlcGV0aWRvOwogICAgZm9yKGludCBpID0gMDsgaSA8IE1BWF9JVEVOUzsgaSsrKSB7CiAgICAgICAgIGNvdXQgPDwgKCJOdW1lcm86ICIpOwogICAgICAgICBjaW4gPj4gdmV0W2ldOwogICAgfQogICAgZm9yKGludCBpID0gMDsgaSA8IE1BWF9JVEVOUzsgaSsrKSB7CiAgICAgICAgcmVwZXRpZG8gPSBmYWxzZTsKICAgICAgICAgZm9yKGludCBqID0gMDsgaiA8IGk7IGorKykgeyAvL3ZlcmlmaWNhIHNlIGV4aXN0ZW0gaWd1YWlzIGFwZW5hcyBlbnRyZSBvcyBhbnRlcmlvcmVzCiAgICAgICAgICAgICBpZiAodmV0W2pdID09IHZldFtpXSkgewogICAgICAgICAgICAgICAgcmVwZXRpZG8gPSB0cnVlOwogICAgICAgICAgICAgICAgYnJlYWs7IC8vdGVtIHJlcGV0aWRvLCBuw6NvIHByZWNpc2EgY29udGludWFyIGNvbSBhIHByb2N1cmEKICAgICAgICAgICAgIH0KICAgICAgICAgfQogICAgICAgICBpZiAoIXJlcGV0aWRvKSB7CiAgICAgICAgICAgICBjb3V0IDw8IHZldFtpXSA8PCBlbmRsOwogICAgICAgICB9CiAgICB9Cn0KIAovL2h0dHBzOi8vcHQuc3RhY2tvdmVyZmxvdy5jb20vcS8zNzAwMi8xMDE=