[백준] 10988 | 팰린드롬인지 확인하기(java)

Yuri Lee·2023년 10월 25일
0

코딩테스트

목록 보기
7/7
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] word ;
		int i;
		word = sc.nextLine().split("");
		
		for(i=0;i<word.length/2;i++){
			if(word[i].equals(word[(word.length-1)-i])){
				continue;
			}else break;
		}
		
		if(i==word.length/2){
			System.out.println("1");
		}else System.out.println("0");
	}
}
profile
유리

0개의 댓글