Problema 1. <html> <head> </head> <body> <script type="text/javascript"> var vec=[0,7,2,3,4,2,6,2,8,2]; var f; var indice=0; do { if (vec[indice]==2) { vec.splice(indice,1,1,1); } indice++; } while (indice<vec.length); for(f=0;f<vec.length;f++) { document.write(vec[f]+' '); } </script> </body> </html>
Retornar al menu |