gonzalo619 Posted December 10, 2013 Report Share Posted December 10, 2013 hola quisiera saber si me pueden ayudar con este problema trate de hacerlo pero no manejo mucho el lenguaje todavia si alguien me podría ayudar se agradecería Link to comment Share on other sites More sharing options...
cañangasñangas Posted December 10, 2013 Report Share Posted December 10, 2013 (edited) no se si esta bien lo hice sin probar, pero la idea del algoritmo se entiende: int ancho=a; int alto=b; int aux = 1; int indexing = -1; (type) arreglo[ancho][alto]; (type) someNewVar[alto*ancho] for(int i=0;i<ancho;i++){ if(aux == 1){ for(int j=0;j<alto;j++){ indexing++; someNewVar[indexing] = arreglo[i][j]; } aux++; } else{ for(int j=alto-1;j>=0;j--){ indexing++; someNewVar[indexing] = arreglo[i][j]; } aux = 1; } } Saludos :adios: Edited December 12, 2013 by cañangasñangas Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now