elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Guía rápida para descarga de herramientas gratuitas de seguridad y desinfección


  Mostrar Temas
Páginas: [1]
1  Programación / Ejercicios / listas en Python en: 9 Noviembre 2009, 20:35 pm
Hola gente como estan?
tengo un problemas de listas por si fueran tan amables de ayudarme
tengo una lista dentro de un vector, algo asi
>>>>   ['la lista']
necesito separar la lista de forma que quede asi ['la', 'lista']
Muchas Gracias
2  Programación / Java / ayuda con este ejercicio en: 12 Agosto 2009, 21:06 pm
porfavor urge la ayuda que me puedan brindar
Código
  1. public class NewClass{
  2.  
  3.      static FileOutputStream istro;
  4.    public static final int longLinea=81;
  5.  
  6.    public static void (String args[]) trows IOException {
  7.        byte nombre[]=new byte[longLinea];
  8.        byte apellidos[]=new byte[longLinea];
  9.        byte ctainicial[]=new byte[longLinea];
  10.        byte cedula[]=new byte[longLinea];
  11.        byte edad[]=new byte[longLinea];
  12.        byte provincia[]=new byte[longLinea];
  13.  
  14.       istro= new FileOutputStream( "registro.dot" );
  15.        while(true) {
  16.            System.err.println("Escriba el nombre, con no termina el almacenamiento");
  17.            LeeLinea(nombre);
  18.  
  19.            if("no".equalsIgnoreCase(new String( )))break;
  20.            System.err.println("Digite su apellido");
  21.            LeeLinea(apellidos);
  22.            System.err.println ("Digite su cedula");
  23.            LeeLinea(cedula);
  24.            System.err.println ("Digite su provincia");
  25.            LeeLinea(provincia);
  26.            System.err.println("Digite su cuenta inicial");
  27.            LeeLinea(ctainicial);
  28.            System.err.println("Digite su edad");
  29.            LeeLinea(edad);
  30.  
  31.            for(int i=0 ; nombre !=0; i++)
  32.               istro.write(nombre);
  33.            istro.write( ',');
  34.  
  35.  
  36.            for(int i=0 ; cedula !=0; i++)
  37.               istro.write(cedula);
  38.            istro.write( ',');
  39.  
  40.            for(int i=0 ; ctainicial !=0; i++)
  41.                istro.write(ctainicial);
  42.            istro.write( ',');
  43.  
  44.            for(int i=0 ; apellidos !=0; i++)
  45.                istro.write(apellidos);
  46.            istro.write( ',');
  47.  
  48.            for(int i=0 ; edad !=0; i++)
  49.                istro.write(edad);
  50.            istro.write( ',' );
  51.  
  52.           for(int i=0 ; provincia !=0; i++)
  53.                istro.write(provincia);
  54.           istro.write( '\n'  );
  55.  
  56.  
  57.        }
  58.        istro.close(); }
  59.  
  60.  
  61.    private static void LeeLinea(byte linea[]) trows IOException {
  62.        int b=0;
  63.        int i=0;
  64.         while( (i < ( longLinea-1) ) && ( ( b = System.in.read() ) != '\n' ) )
  65.            linea[i++] = (byte)b;
  66.        linea = (byte)0;
  67.  
  68.  
  69.    }
  70.  
  71.  
  72. }
3  Programación / Java / ayuda en: 12 Agosto 2009, 20:25 pm
HOla no se por que esto no me funciona ayudaaaaa


Código
  1. import java.io.*;
  2.  
  3.  
  4. public class NewClass{
  5.  
  6. static FileOutputStream istro;
  7. public static final int longLinea=81;
  8.  
  9. public static void (String args[]) trows IOException {
  10. byte nombre[]=new byte[longLinea];
  11. byte apellidos[]=new byte[longLinea];
  12. byte ctainicial[]=new byte[longLinea];
  13. byte cedula[]=new byte[longLinea];
  14. byte edad[]=new byte[longLinea];
  15. byte provincia[]=new byte[longLinea];
  16.  
  17. istro= new FileOutputStream( "registro.dot" );
  18. while(true) {
  19. System.err.println("Escriba el nombre, con no termina el almacenamiento");
  20. LeeLinea(nombre);
  21.  
  22. if("no".equalsIgnoreCase(new String( )))break;
  23. System.err.println("Digite su apellido");
  24. LeeLinea(apellidos);
  25. System.err.println ("Digite su cedula");
  26. LeeLinea(cedula);
  27. System.err.println ("Digite su provincia");
  28. LeeLinea(provincia);
  29. System.err.println("Digite su cuenta inicial");
  30. LeeLinea(ctainicial);
  31. System.err.println("Digite su edad");
  32. LeeLinea(edad);
  33.  
  34. for(int i=0 ; nombre[i] !=0; i++)
  35. istro.write(nombre[i]);
  36. istro.write( ',');
  37.  
  38.  
  39. for(int i=0 ; cedula[i] !=0; i++)
  40. istro.write(cedula[i]);
  41. istro.write( ',');
  42.  
  43. for(int i=0 ; ctainicial[i] !=0; i++)
  44. istro.write(ctainicial[i]);
  45. istro.write( ',');
  46.  
  47. for(int i=0 ; apellidos[i] !=0; i++)
  48. istro.write(apellidos[i]);
  49. istro.write( ',');
  50.  
  51. for(int i=0 ; edad[i] !=0; i++)
  52. istro.write(edad[i]);
  53. istro.write( ',' );
  54.  
  55. for(int i=0 ; provincia[i] !=0; i++)
  56. istro.write(provincia[i]);
  57. istro.write( '\n' );
  58.  
  59.  
  60. }
  61. istro.close(); }
  62.  
  63.  
  64. private static void LeeLinea(byte linea[]) trows IOException {
  65. int b=0;
  66. int i=0;
  67. while( (i < ( longLinea-1) ) && ( ( b = System.in.read() ) != '\n' ) )
  68. linea[i++] = (byte)b;
  69. linea[i] = (byte)0;
  70.  
  71.  
  72. }
  73.  
  74.  
  75. }
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines