int percent = (score/numberOfQuestions)*100; progressText.setText(score+"/"+numberOfQuestions+" "+percent+"%");
返回0%,不管我累了.我尝试将其转换为int,double,float
为什么它返回0%的数字,如score = 5 numberOfQuestions = 8?
int percent = (score * 100 / numberOfQuestions);
那么* 100将首先执行,那么除法将给你正确的结果.