Please tell me how to write this
彦骐
彦骐 2021-04-28 14:39:06
0
1
1081

Verify the 18-digit identity number and determine the gender of the identity owner. The rules for the identity number are:

① The first 17 digits are all composed of numbers, the last digit is a number or the character 'X', and a character ch The

condition for numbers is: ch>='0' && ch<='9';

② If the 17th digit is an odd number, it means the gender is male, and if it is an even number, it means the gender is female.

Input: Enter an 18-digit identity number from the keyboard and save it in the character array Card.

Output: Host gender.

彦骐
彦骐

reply all(1)
清

(substr($idnum, 16, 1) % 2 == 1) ? 'Male' : 'Female';

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template