Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void zam(int *a, int *b){
- int zacas;
- zacas=*a;
- *a=*b;
- *b=zacas;
- }
- int main() {
- int polje[20] = {20, 9 ,1, 30, 14, 3, 5, 8, 22, 16, 69, 100, 45, 32, 11, 4, 7, 4, 19, 25};
- //BubbleSort(&polje);
- /* for(int i=0;i<20);i++){
- if(polje[i]>polje[i+1]){
- }
- }
- */
- int arr[5] = {2,4,3,5,1};
- //for(int i=1;i<5;i++){
- for(int j=0;j<5;j++){
- if(arr[j]>arr[j+1]){
- zam(&arr[j],&arr[j+1]);
- cout << arr[j] << " " << arr[j+1] << " ";
- }
- //}
- }
- //int velikost_polja = sizeof(polje)/sizeof(polje[0]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement