Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- using namespace std;
- int main()
- {
- /* Obliczanie */
- int n = 8;
- double T[n] = {5,7,8,9,8,9,1,6};
- for(int i = 0 ; i < n ; i++){
- for(int j = 1 ; j < n-i; j++)
- {
- if(T[j] < T[j-1])
- {
- swap(T[j-1] , T[j]);
- }
- }
- }
- /*Wyprowadzenie */
- for(int j = 0; j < 8 ; j++){
- cout << T[j] << ", ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement