0
Transportation Quiz
Man, I’m dying with this. My head is burning. More explanation please
5 Respostas
+ 3
What is the temprature of head now? 😀😀
+ 2
#include <iostream>
using namespace std;
int main() {
//your code goes here
int waitingpassangers;
cin >> waitingpassangers;
int buscapacity = 50;
int peopleinthelastbus = waitingpassangers % buscapacity;
int emptyseats = 50 - peopleinthelastbus;
cout << emptyseats;
return 0;
}
https://code.sololearn.com/cJYedjMv5VBS/?ref=app
+ 1
😅😅 thanks for helping guy. Still need sometimes to restart ma brain
0
some tasks are really able to move the brains in the literal sense 😆
0
#include <iostream>
using namespace std;
int main() {
//your code goes here
int passengers;
cin >> passengers ;
int seat = passengers % 50;
if(passengers >= 50) {
if(seat > 50) {
cout << seat << endl;
}
}
if(seat < 50) {
cout << 50 - seat << endl;
}
return 0;
}
I tried the module myself without copying the other people's code. And this module force me to use the if statement to get this correct.(I know that you can do this without the if statement, but using upper lesson to solve the previous module helps sometimes)
I used the other's people code to do this module, but after I learned c++ for a long time this took me many tries to make my own code correct because I don't really understand math logic XD