Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int tab[10];
- int *wtab;
- wtab=tab;
- cout << "podaj liczby do tablicy: " << endl;
- for(int i=0; i<10; i++)
- {
- cin >> *(wtab + i);
- for(int j=i-1; j>=0; j--)
- if(tab[j]>tab[j+1])
- {
- int temp=tab[j];
- tab[j]=tab[j+1];
- tab[j+1]=temp;
- }
- }
- for(int i=0; i<10; i++)
- cout << tab[i] << " ";
- system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment