Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int MAX_PASSWORD = 6;
- bool no_esta_repetido(int valores[], int siguiente, int limite);
- int main(int argc, char * argv[]){
- int arr[] = { 1, 4, 5, 7, 5, 7, 8, 2 };
- for (int valor = 0; valor < 8; ++valor){
- if (valor == 0)
- cout << arr[valor] << " ";
- else{
- if (!no_esta_repetido(arr, arr[valor], valor)){
- cout << arr[valor] << " ";
- }
- }
- }
- std::cin.get();
- }
- bool no_esta_repetido(int valores[], int siguiente, int limite){
- for (int valor = 0; valor < limite; ++valor)
- if (valores[valor] == siguiente)
- return true;
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement