rendered paste body#include <cstdlib>#include <iostream>#include <conio.h>using namespace std;void bubblesort( int a[],int n ) { int i,j; int tmp; int change; for (i=0; i<n-1; ++i) { change=0; for (j=0; j<n-1-i; j++) { if (a[j+1] < a[j]) //porównanie sąsiądów { tmp = a[j]; a[j] = a[j+1]; a[j+1] = tmp; //wypchanie bąbelka change=1; } } if(!change) break; // nie dokonano zmian - koniec! }}int main(int argc, char *argv[]){ int a[10]; cout << "Podaj 10 liczb. \n\n"; for(int i = 0; i<=9; i++) { cout << "Podaj " << i+1 << " liczbe: "; cin >> a[i]; } bubblesort(a,10); cout << "Sortowanie... " << endl; for(int i = 0; i<=9; i++) { cout << "a[" << i << "] = " << a[i] << endl; } getch(); }