Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n=10;
- int d[n];
- cout<<"Podaj elementy do posortowania: "<<endl;
- for(int i=0; i<10;i++)
- {
- cout<<"Wypisz element nr: "<<i+1<<endl;
- cin>>d[i];
- }
- for(int j=0;j<n-1;j++)
- for(int i=0;i<n-1-j;i++)
- if(d[i]>d[i+1])
- swap(d[i], d[i+1]);
- for(int i=0;i<10;i++)
- {
- cout<<d[i]<<" ";
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement