
07/02/2005, 12:24
|
| | Fecha de Ingreso: enero-2005
Mensajes: 10
Antigüedad: 20 años, 1 mes Puntos: 0 | |
dios taito no me digas que todo el follon ha sido solo por eso???? Madre miaaaaaaaaaaaaaaa. Gracias a todos por la ayuda!!! De todas formas al final consegui resolverlo de otro modo por si a alguien le surge el mismo problema que a mi alguna vez. Aqui lo dejo:
import java.io.*;
public class ejercicio27
{
public static void main (String [] args)throws IOException
{
String aux;
int i;
BufferedReader in =new BufferedReader (new InputStreamReader (System.in));
int a;
String unaLinea;
System.out.println ("Introduce un entero: ");
unaLinea = in.readLine();
a=Integer.parseInt(unaLinea);
int x=unaLinea.length();
char j=unaLinea.charAt(x-1);
aux=""+j;
for (i=x-1;i>=0;i--)
{
char ch=unaLinea.charAt(i);
if(i<x-1)
{
aux=aux+ch;
}
}
System.out.println ("El numero invertido es: "+aux);
}
} |