+ 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()); } }

16th Feb 2022, 7:32 AM
Nipun
Nipun - avatar
2 odpowiedzi
+ 2
16th Feb 2022, 7:19 PM
JaScript
JaScript - avatar
+ 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'...
16th Feb 2022, 8:13 AM
Brian
Brian - avatar