cannot convert from int to boolean
//根據身份證號碼判斷性別(18位身份證)
private int discernSexByIdCode(String str){
int sex = 0;
if (str.length()==18) {
int n = str.charAt(17);
sex = n%2;
if (sex==0) {
sex=1;
} else {
sex=2;
}
}
return sex;
}