#include <iostream>
using namespace std;
int main() {
    int n ,B[10], A[10]={123, 321, 52, 61 , 2, 87, 45, 98, 369, 55};
    cout << "Liczby przed sortowaniem rosnącym: " << endl;
    for(int i=0; i<10; i++)
    cout << A[i] << " ";
    B[0]=A[0];
        for (int i=1; i<10; i++)
        {
            n = A[i];
            int j=0;
            while (n>B[j]&& j<i)
                j++;
            for (int k=i;k>j;k--)
                B[k]=B[k-1];
            B[j]=n;
        }
 cout << endl << "Tablica po sortowaniu :\n" ;
    for(int i=0; i<10; i++)
    cout << B[i] << " ";
    cout << endl;
    
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: