public static int check ( long n ) {
  long x = n ;
  while ( x != 0 ) {
    if ( x % 10 != 0 && n % ( x % 10 ) != 0 ) return - 1 ;
    x /= 10 ;
  }
  return 1 ;
}

public static int check ( long n ) { long x = n ; while ( x != 0 ) { if ( x % 10 != 0 && n % ( x % 10 ) != 0 ) return - 1 ; x /= 10 ; } return 1 ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (integral_type) name: (identifier))) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) (while_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal)) right: (binary_expression left: (binary_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal)))) right: (decimal_integer_literal)))) consequence: (return_statement (unary_expression operand: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (decimal_integer_literal))))) (return_statement (decimal_integer_literal))))