+ 5
Its printimg reverse order for the lower what can i do
//Task: Create a program that replaces each letter in a message with its corresponding letter in a backwards version of the English alphabet. Input Format: A string of your message in its normal form. Output Format: A string of your message once you have encoded it (all lower case). Sample Input: Hello World Sample Output: svool dliow import java.util.*; import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String str = sc.nextLine(); StringBuilder sb = new StringBuilder(str); sb.lower(); System.out.println(sb.reverse().toString()); } }
2 Réponses
+ 2
Nipun this can be solved ie as follows:
https://code.sololearn.com/cXtc5dSR1m7V/?ref=app
+ 4
The task is not to reverse the string, but rather to reverse the alphabet letters in the string. 'a' becomes 'z', 'b' becomes 'y', 'c' becomes 'x'...