I'm still confuse to this 12 Code project in Basic Concept. do you have any idea to help me? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I'm still confuse to this 12 Code project in Basic Concept. do you have any idea to help me?

You are making a program for a bus service. A bus can transport 50 passengers at once. Given the number of passengers waiting in the bus station as input, you need to calculate and output how many empty seats the last bus will have. Sample Input: 126 Sample Output: 24 Explanation: The first bus will transport 50 passengers, leaving 126-50=76 in the station. The next one will leave 26 in the station, thus, the last bus will take all of the 26 passengers, having 50-26=24 seats left empty.

5th Sep 2021, 5:42 AM
Christian Joseph E Marigmen
Christian Joseph E Marigmen - avatar
2 Answers
+ 3
Think of it this way, people on the bus and empty seats are the opposite, there won't be empty seats as long as the bus is full, finally you can calculate the empty seats when the bus isn't full Take a look if you still don't understand the logic, if you decide to do so, try to understand it, translate it to C++/python according to your profile, and shorten it as possible as you can: https://code.sololearn.com/ctN8NSg496Nm/?ref=app
5th Sep 2021, 5:53 AM
Tim
Tim - avatar
+ 2
Thanks for the advice. I understand now. Thank you
5th Sep 2021, 6:23 AM
Christian Joseph E Marigmen
Christian Joseph E Marigmen - avatar