// sortarr.cpp: Sorting an array
#include <iostream>
#include <algorithm>
using namespace std;

int main() {
 int a[10], x, n = 0, *p;
 cout << "Enter at most 10 positive integers, followed by 0:\n";
 while(cin >> x, x != 0 && n < 10) a[n++] = x;
 sort(a, a+n);
 cout << "After sorting: \n";
 for (p = a; p != a+n; ++p) cout << *p << " ";
 cout << endl;
 return 0;
}
