0
This c++ code dosent work for me
https://code.sololearn.com/cslFrOI1bNYd/?ref=app This code is for 1st project of c++ course but for some reason it just prints the input which is "t"
2 ответов
+ 6
It only prints the input unchanged if -50 < t < 50, that's the whole point of the modulo operator in that case. However, the issue in regards to the task is that you don't calculate the number of seats left, but the number of passengers on the last bus. Review the example given in the task description as well as the modulo operator if necessary for this.
The number of free seats is equal to the number of passengers on the last bus subtracted from the total number of seats in the bus.
+ 1
Kairav Bhatia
You are just getting reminder but not subtracting from 50 which is left passengers.
So There should be
50 - t % 50;