백준 1259번(Java)

박은지·2025년 2월 4일

백준

목록 보기
7/89
post-thumbnail

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String result = "";
		while(true) {
			
			String nums = br.readLine();
			boolean check = true;
			
			if(nums.equals("0"))
				break;
			
			for(int i=0; i<nums.length()/2; i++) {
				if(nums.charAt(i) != nums.charAt(nums.length()-1-i))
					check = false;
			}
			if(check)
				result += "yes"+"\n";
			else
				result += "no"+"\n";
		}
		System.out.println(result);
	}
}
profile
백엔드 개발자가 되고싶은 eunzi😊

0개의 댓글