-
-
Save sanrodari/2731583 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Ensayo { | |
public static void main(String[] args) { | |
String inv = ""; | |
System.out.println(convertir("1234")); | |
} | |
public static String convertir(String num) { | |
String inv = ""; | |
for (int i = num.length() - 1; i >= 0; i--) { | |
inv += num.charAt(i); | |
} | |
return inv; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment