You are on page 1of 1

#include<iostream>

using namespace std;

int main(){

int i, x = 0;
int vet1[5], vet2 [5], juncao [x], moda[10];

for(i = 0; i < 10; i++){


juncao[i] = 0;
}

cout << "Insira o primeiro Vetor: ";


for(i = 0; i < 5; i++){
cin >> vet1[i];
}

cout << "Insira o segundo Vetor: ";


for(i = 0; i < 5; i++){
cin >> vet2[i];
}

for(i = 0; i < 5; i++){


if(vet1[i] != juncao[0] && vet1[i] != juncao[1] && vet1[i] != juncao[2] && vet1[i] !=
juncao[3] && vet1[i] != juncao[4]){
juncao[x] = vet1[i];
x++;
}
}

for(i = 0; i < 5; i++){


if(vet2[i] != juncao[0] && vet2[i] != juncao[1] && vet2[i] != juncao[2] && vet2[i] != juncao[3]
&& vet2[i] != juncao[4]
&& vet2[i] != juncao[5] && vet2[i] != juncao[6] && vet2[i] != juncao[7] && vet2[i] !=
juncao[8] && vet2[i] != juncao[9]){
juncao[x] = vet2[i];
x++;

cout << "Juncao:\n";


for(i = 0; i < x; i++){
cout << juncao[i] << " ";
}

You might also like