Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- const int size=10;
- int pole[size]={5,8,7,6,3,2,1,4,9,0};
- void bsort(int *arr,int n)
- {
- for(int i=1;i<=n;i++)
- {
- for(int j=0;j<n-i;j++)
- {
- if(arr[j]>arr[j+1])
- {
- int pom=arr[j];
- arr[j]=arr[j+1];
- arr[j+1]=pom;
- }
- }
- }
- }
- int main()
- {
- cout << "Neserazene pole:" <<endl;
- for(int i=0;i<size;i++) cout<<pole[i]<<" ";
- cout << endl << "Serazene pole:" <<endl;
- bsort(pole,size);
- for(int i=0;i<size;i++) cout<<pole[i]<<" ";
- cout<<endl<<endl;
- system("PAUSE");
- }
Add Comment
Please, Sign In to add comment