Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstdlib>
- #include<ctime>
- using namespace std;
- int highest(int tab[])
- {
- int max = 20;
- int numer;
- for (int n = 0; n < 99; n++)
- {
- if (tab[n] >= max)
- {
- max = tab[n];
- numer = n;
- }
- }
- //cout << "Najwieksza liczba to:" << max << " na pozycycji:" << numer << endl;
- return numer;
- }
- void sortuj(int tab[])
- {
- for (int n = 0; n < 99; n++)
- {
- for (int i = 1; i < 99 - n; i++)
- {
- if(tab[])
- }
- }
- }
- int main()
- {
- srand(time(NULL));
- int array[100];
- for (int n = 0; n < 99 ;n++)
- {
- array[n] = rand() % 181 + 20;
- }
- for (int n = 0; n < 99; n++)
- {
- cout << array[n] << " ";
- }
- int x= highest(array);
- cout << endl<<"x="<<x;
- int *ptr = &array[x];
- cout << endl << "Adres przechowywany przez wskaznik: " << ptr << endl;
- cout << "Adres zmioennje x: " << &x;
- sortuj(array);
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement