Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int i = 0;
- int ii = 0;
- int j = 0;
- int jj = 0;
- int band = 0;
- int encontrado = 0;
- int* numeros = NULL;
- int* nrepetidos = NULL;
- int n = 0;
- cout<<"Conocer la cantidad de numeros y ordenarlos"<<endl;
- cout<<endl;
- cout<<"ingrese la cantidad de numeros que se usaran";
- cin>>n;
- for(i=0;i<n;i=i+1){
- cout<<"numero"<<i<<". ";
- cin>>numeros[i];
- }
- for(i=0;i<n;i=i+1){
- for(j=0;j<n;j=j+1){
- if(numeros[j]<<numeros[j+1]){
- band = numeros[i];
- numeros[j] = numeros[j+1];
- numeros[j] = band;
- }
- }
- }
- for(ii=0;ii<n;ii=ii++){
- if (nrepetidos[ii]=0)
- numeros[ii]= nrepetidos[ii];
- else{
- for(jj=0;jj<n;jj++){
- if(numeros[ii]= nrepetidos[jj]){encontrado = 1;
- }
- if(encontrado=0);{
- numeros[ii] = nrepetidos[jj];
- }
- }
- }
- }
- for(i=0;i<n;i=i+1){
- }
- cout<<"Los numeros quedaran odenados de la siguiente manera: "<<nrepetidos<<endl;
- system ("PAUSE");
- return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement