var num =prompt("请输入一个整数"); if(num % 2 ==0){ alert(num + "是一个偶数") }else if(num % 2 == 1){ alert(num + "是一个奇数") }else{ alert("error") }