ayuda
me imprime 10 veces v
donde esta el problema, quiero que me ordene de menor a mayor
Gracias
Código
#include <iostream> using namespace std; void bubble(int v[], int dim) { int tmp; for(int i=dim-1; i>0; i--) { for(int j=0; j<i; j++) { if(v[j]>v[j+1]) { tmp=v[j]; v[j]=v[j+1]; v[j+1]=tmp; } } } } int main() { int v[]={5,4,2,54,32,33,55,9,66,12}; for(i=0; i<10; i++) cout<<"v[i]"<<" "; cout<<endl; }