-2
// The "PalinDrome" class.
import java.awt.*;
import hsa.Console;
public class PalinDrome
{
static Console c; // The output console
public static void main (String[] args)
{
c = new Console();
c.println("Please enter a word");
String word = c.readLine();
int i;
int num = word.length();
String str = "";
for (i = num - 1 ; i >= 0 ; i--)
str = str + word.charAt (i);
if (str.equals (word))
c.println (word + " is a palindrome");
else
c.println (word + " is not a palindrome");
str.equalsIgnoreCase(word);
// Place your program here. 'c' is the output console
} // main method
} // PalinDrome class
나는 시험 프로젝트의 일부로 palindrome 프로그램을 만들었습니다. 글자가 삼각형 모양으로 나타나기를 바랍니다. 내가 그걸 어떻게 할 수 있는지에 대한 제안이 있니?텍스트 삼각형 텍스트 상자 만드는 방법
문자열 연결을 사용하여 매번 새로운 문자열을 생성하는 대신 StringUtils를 사용하여 문자열을 반전하고 한 번만 연결해야합니다 원본으로. – Quetzalcoatl