#include<iostream> using namespace std; void insertion_sort(int arr[], int n) { for (int i = 1; i < n; i++) { if (arr[i-1] > arr[i]) { int temp = arr[i]; int j = i; while (j > 0 && arr[j-1] > temp) { arr[j] = arr[j-1]; j--; } arr[j] = temp; } } } int main() { int arr[10]; for (int i = 0; i < 10; i++) scanf("%d", &arr[i]); insertion_sort(arr, 10); for (int i = 0; i < 10; i++) printf("%d ", arr[i]); printf(" "); return 0; }