public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); String str = sc.nextLine(); String[] a = str.split("\\."); int[]b= new int[4]; for(int i=0;i<4;i++){ b[i]= Integer.parseInt(a[i]); } if(b[0]>255 ||b[1]>255 || b[2]>255 || b[3]>255 ){ System.out.println("NO"); }else{ System.out.println("YES"); } } }
全部评论
(1) 回帖