hindi ko makuha mga paps, nauubusan ako ng idea e. pahelp naman mga paps
Calling po sa mga expert dyan
Attachments
-
You do not have permission to view the full content of this post. Log in or register now.
public class Main {
public static void main(String[] args) {
String out = swap("123456");
System.out.print("Out: " + out);
}
public static String swap(String str){
return str.charAt(str.length()-1) +
str.substring(1, str.length() - 1) +
str.charAt(0);
}
}
awts medyo advance na ata yan paps, pero salamat parinIf no rule sa pagcode you can use this String method:
Java:public class Main { public static void main(String[] args) { String out = swap("123456"); System.out.print("Out: " + out); } public static String swap(String str){ return str.charAt(str.length()-1) + str.substring(1, str.length() - 1) + str.charAt(0); } }