total>=100?total*0.8:total;//true执行冒号前面的;false执行冒号后面的
等价于
if(total>=100){
total=total*0.8;
}else{
total=total;
}