/* Silly Software Productions (c) Koen Noens, 13/3/2002 */ #include // const voor alle functies (array upper boundary) const top = 6; //prototypes void vularray(int Array[]); void sorteer (int array[]); void show(int array[]); //main void main() { int SpelerGetallen [top]; vularray2(SpelerGetallen); show(SpelerGetallen); sorteer(SpelerGetallen); show(SpelerGetallen); cout << endl; cin.get(); } //functies void vularray(int Array[]) { int j = 0; cout << "\ngeef 6 getallen :\n"; for(int i = 0; i < top; i++) { do // controle op bereik { cout << "\tx "; cin >> Array[i]; if(Array[i]<=0 || Array[i] > 42) { cout << "\t\tdit is geen geldig getal." << endl << "\t\tgeef een getal van 1 tot 42" << endl; }; } while(Array[i]<=0 || Array[i] > 42); // controle op dubbels j = 0; while (j < i) { if (Array[j] == Array[i]) { cout << "\t\t" < array[j]) { x = array[j]; array[j] = array[i]; array[i] = x; } } } }