rendered paste body#include <cmath>#include <iostream>#include <iomanip>using namespace std;int N; // Liczebność zbioru.// Program główny//---------------int main(){ int d[N],i,j,x; cout << "Sortowanie przez wstawianie\n"; cout << "Wybierz ilosc liczb: "; cin >> N; cout << "Wprowadz liczby: \n"; for(i = 0; i < N; i++) { cin >> d[i]; } i = 0; // PRZED Sortujemy printf ("\n \nPRZED SORTOWANIEM: \n"); for(i = 0; i < N; i++) { cout << d[i]; printf (", "); } printf ("\n\n-------------------------------------------------------- \nPO SORTOWANIU: \n");// Sortujemy for(j = N - 2; j >= 0; j--) { x = d[j]; i = j + 1; while((i < N) && (x > d[i])) { d[i - 1] = d[i]; i++; } d[i - 1] = x; }// Wyświetlamy wynik sortowania for(i = 0; i < N; i++) { cout << d[i]; printf (", "); } cout << endl; system("PAUSE"); return 0;}