Ver Mensaje Individual
  #3 (permalink)  
Antiguo 28/09/2011, 08:25
Avatar de afrika026
afrika026
 
Fecha de Ingreso: junio-2011
Mensajes: 85
Antigüedad: 12 años, 10 meses
Puntos: 19
Respuesta: Por favor solo este problemita

el codigo anterior esta mal, este es el codigo correcto.

int resultado=0;
String numero = "1234";
for(int i = 0; i < numero.length(); i++) {
resultado=resultado+Integer.valueOf(numero.charAt (i)).intValue();
}