Proverit yavlyaetsya li chetirehznachnoe chislo schstlivim biletom

import java.util.Scanner;

public class Homework5 {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int numbers=in.nextInt();
int a=numbers%100000/1000;
int b=numbers%1000/100;
int c=numbers%100/10;
int d=numbers%10;
if(a+b==c+d){
System.out.println(“Lucky ticket”);
}
else {
System.out.println(“Error”);
}
}
}

Предложенное вами решение верное