I tried to make a program that order the numbers in a vector, but after I insert the values from keyboard, nothing happens. Can you please help me?
#include <iostream>
using namespace std;
int vect[100],n;
void order_vector(int v[100],int n){
int i,t=0;
for(i=1;i<n;i++){
if (v[i]<v[i-1]){
t=v[i];
v[i]=v[i-1];
v[i-1]=t;
}
}
}
void show_vector(int v[100]){
for(int i=0;i<n;i++){
cout<<v[i]<<" ";
}
cout<<endl;
}
void create_vector(int v[100],int lenght){
for(int i=0;i<lenght;i++){
cout<<"vector["<<i<<"]=";
cin>>v[i];
}
}
void main(){
int n;
cin>>n;
create_vector(vect,n);
order_vector(vect,n);
show_vector(vect);
cin>>n;
}