As vezes vendo o exercicio resolvido e tentando perceber todos os passos é onde se aprende melhor. Deixo aqui um código que fiz rapidamente. Pode ter problemas, mas funciona para o objetivo proposto.
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
const int NNUMEROS = 5;
int main()
{
int numeros[NNUMEROS];
// Preencher o Array
for (int i = 0; i < NNUMEROS; i++)
{
system("CLS");
cout << ">> Introduz um numero. \n>> ";
while (!(cin >> numeros[i]))
{
cin.clear();
string dummy;
cin >> dummy; // throw away garbage.
cout << ">> Nao introduziste um numero.\n>> ";
}
if (cin.eof())
{
cin.clear();
}
}
system("CLS");
// Colocar por ordem crescente
cout << ">> Deseja colocar os numeros por ordem crescente? S ou N \n>> ";
char dados;
cin >> dados;
if (dados == 'S' || dados == 's')
{
for (int j = 0; j < NNUMEROS; j++)
{
int index = j;
int menor = numeros[j];
for (int i = j; i < NNUMEROS; i++)
{
if (numeros[i] < menor)
{
menor = numeros[i];
index = i;
}
}
int y;
y = numeros[j];
numeros[j] = menor;
numeros[index] = y;
}
}
// Mostrar o array
system("CLS");
for (int i = 0; i < NNUMEROS; i++)
{
cout << numeros[i] << " ";
}
cout << endl;
}