Código
#include<iostream> #include<stdlib.h> using namespace std; class vector{ private: int v[4], i, j, aux; public: vector(){} ~vector(){} void leer(){ cout<<"Introducir 10 valores: "<<endl; for(i = 0; i < 4; i++){ cout<<"digite el numero "<<i+1<<": "; cin>>v[i]; } system("cls"); } void ordenar(){ for(j = 0; j <4; j++){ for(i = 0; i < 4; i++){ if(v[i] > v[i+1]){ aux = v[i]; v[i] = v[i+1]; v[i+1] = aux; } } } } void mostrar(){ cout<<"Orden Introducido:\n"; for(i = 0; i < 4; i++){ cout<<v[i]<<endl; } ordenar(); cout<<"\nOrden de menor a mayor:\n"<<endl; for(i = 0; i < 4; i++){ cout<<v[i]<<endl; } } }; int main(){ vector V; V.leer(); V.mostrar(); return 0; }