int a=5; int b=10; int percent=a/b100; //這樣是錯誤的,因為根據類型的話就是0; int a=5; int b=10; int percent=a * 100 / b; //這樣就得到正確的百分比
個人微信號
微信掃一掃加關注
發表評論 取消回復