๋ฐ์ํ
import java.util.Scanner;
// 10988 ํฐ๋ฆฐ๋๋กฌ์ธ์ง ํ์ธํ๊ธฐ
public class CheckingPalindrome {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String s = in.next();
in.close();
int sL = s.length();
int res = 1;
for (int i = 0; i < sL; i++) {
if (s.charAt(i) != s.charAt(sL -1 - i)) {
res = 0;
}
}
System.out.println(res);
}
}
๋ฐ์ํ
'๐ธ Algorithm > ๐ธ ๋ฐฑ์ค BaekJoon' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค][java][2941][ํฌ๋ก์ํฐ์ ์ํ๋ฒณ] (0) | 2024.02.10 |
---|---|
[๋ฐฑ์ค][java][1157][๋จ์ด ๊ณต๋ถ] (1) | 2024.02.08 |
[๋ฐฑ์ค][java][2444][๋ณ ์ฐ๊ธฐ - 7] (0) | 2024.02.04 |
[๋ฐฑ์ค][java][3003][ํน, ํธ, ๋ฃฉ, ๋น์, ๋์ดํธ, ํฐ] (0) | 2024.02.03 |
[๋ฐฑ์ค][java][25083][์์น] (0) | 2024.01.29 |