DiQ

kolo2

DiQ
Jan 19th, 2014
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. int tab[10];
  7. int *wtab;
  8. wtab=tab;
  9. cout << "podaj liczby do tablicy: " << endl;
  10. for(int i=0; i<10; i++)
  11. {
  12. cin >> *(wtab + i);
  13. for(int j=i-1; j>=0; j--)
  14. if(tab[j]>tab[j+1])
  15. {
  16. int temp=tab[j];
  17. tab[j]=tab[j+1];
  18. tab[j+1]=temp;
  19. }
  20. }
  21. for(int i=0; i<10; i++)
  22. cout << tab[i] << " ";
  23. system("pause");
  24. return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment