fork download
  1. /// Taller 3 ///
  2.  
  3. /// 2) Hacer el programa en C++ que lea un vector A de 30 elementos (numeros enteros y positivos), que cree un nuevo vector que solo contenga los elementos que no se repiten del vector A.///
  4.  
  5. #include <iostream>
  6. using namespace std;
  7. int main()
  8. {
  9. long int A[30],i,j,q,D[30];
  10. for(i=0;i<=29;i++)
  11. {
  12. cout<<"Vector " <<i+1 <<" Ingrese Numero"<<": ";
  13. cin>>A[i];
  14. }
  15. for(i=0;i<=29;i++)
  16. {
  17. q=0;
  18. for(j=0;j<=29;j++)
  19. {
  20. if(A[i]==A[j])
  21. {
  22. q=q+1;
  23. }
  24. }
  25. if(q<=1)
  26. {D[i]=A[i];}
  27. else
  28. {D[i]=0;}
  29. }
  30. for(i=0;i<=29;i++)
  31. {
  32. if(D[i]!=0)
  33. {
  34. cout <<"del Vector: " <<i+1 <<" Numeros No Repetidos: " <<D[i] <<endl;
  35. }
  36. }
  37. system(("PAUSE"));
  38. }
  39.  
  40.  
Compilation error #stdin compilation error #stdout 0.02s 2728KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:37: error: ‘system’ was not declared in this scope
stdout
Standard output is empty