Someone has 100,000 yuan and needs to pay a toll every time he crosses the intersection. The rules are:
1. When the cash is > 50,000, pay 5% each time
2. When the cash is < 50,000 When paying 5000 each time
Answer: Calculate how many intersections the person can pass
By the way, where are the rules and fees so high?
First draw a rough outline, and then slowly write the logic, it will not be difficult to understand
$money = 100000;
$num = 1;
if($money > 50000){
//Pay 5%
}else{
//Pay 5000
}