Advertisement
lewapkon

babel.cpp

Mar 5th, 2014
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. /*
  2.  * Autor: Paweł Koniarski
  3.  * Data: 5 marca 2014 r.
  4.  * Problem: Program sortujący dowolną liczbę liczb metodą bąbelkową.
  5.  * Specyfikacja:
  6.  *     Dane: w zeszycie
  7.  *     Wyniki: w zeszycie
  8.  * Plik: babel.cpp
  9.  **/
  10.  
  11. #include <iostream>
  12.  
  13. using namespace std;
  14.  
  15. const MAX = 100
  16.  
  17. int main()
  18. {
  19.     int i, j, n;
  20.     int l[MAX];
  21.    
  22.     cout << "Podaj rozmiar tablicy: ";
  23.     cin >> n;
  24.     cout << "Wpisz " << n << " liczb:\n";
  25.     for (i = 0; i < n; i++)
  26.         cin >> l[i]
  27.    
  28.     for (i = 0; i < n; i++)
  29.         for (j = 0; j < n-i; j++)
  30.             if (l[j] > l[j+1]
  31.             {
  32.  
  33.             }
  34.    
  35.     cout << endl << endl;
  36.     system("pause");
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement