- Forward Or Backward Here Are Two Sample Runs Enter A String Abcdcba The Input String Is A Palindrome Enter A Str 1 (45.75 KiB) Viewed 32 times
forward or backward. "Here are two sample runs: *Enter a string: abcdcba The input string is a palindrome. * Enter a str
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
forward or backward. "Here are two sample runs: *Enter a string: abcdcba The input string is a palindrome. * Enter a str
forward or backward. "Here are two sample runs: *Enter a string: abcdcba The input string is a palindrome. * Enter a string: abcdefg The input string is not a palindrome. import java.util.Scanner; public class PalindromeStack (. public static void main(String args) { System.out.print("Enter a string: "); Scanner input = new Scanner(System.in); Strings input.next(); // input string String (= "; // reverse string ArrayStack stack=new ArrayStack(); ADD YOUR CODE HERE else if (s.equals(t)) System.out.printini The input string is a palindrome."); 4 System.out.println("The input string is not a palindrome."); // end main // end PalindromeStack