int a=5; int b=10; int percent=a/b100; //这样是错误的,因为根据类型的话就是0; int a=5; int b=10; int percent=a * 100 / b; //这样就得到正确的百分比
个人微信号
微信扫一扫加关注
发表评论 取消回复