Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vetorB[i] = 30 + ( rand() % 70 );
- printf("%d, ",vetorA[i]);
- printf("Elementos de B:{ ");
- printf("%d, ",vetorB[i]);
- if (vetorA[i] == vetorB[a])
- {
- tamVetor++;
- vetorIn[c] = vetorA[i];
- vetorR[c] = a; //guarda os indices dos elementos do vetorB que tambem estao no vetorA
- c++;
- }//fecha o if
- }// fecha for de dentro
- }//fecha o for de fora
- printf(" tamanho do vetor e: %dn", tamVetor);
- printf("Os elementos da Intersecao entre A e B sao: { ");
- for(int i = 0; i < tamVetor; i++)
- {
- printf("%d, ", vetorIn[i]);
- }
- printf("}n");
- tamVetorU++;
- vetorU = realloc(vetorU,sizeof(int*)*tamVetorU);
- if (i == vetorR[c])
- {
- }
- else
- vetorU = realloc(vetorU,sizeof(int*)*tamVetorU);
- Conjuntos();
- return 0;
Add Comment
Please, Sign In to add comment