- 5

Who has solved the Transportation problem under the Cpp..Its confusing me.. Any help please 🙏

13th Jan 2021, 10:35 PM
Ahadjie Bless
Ahadjie Bless - avatar
10 Respuestas
+ 1
Please show us first your attempt, or if you have one, please share it so we may help. Thanks. Here are hints: https://www.sololearn.com/Discuss/2655123/?ref=app
14th Jan 2021, 2:44 AM
noteve
noteve - avatar
+ 1
Don Full In challenges, you need to get the input. The reason why, is so that whatever the input may be, your code will work and will satisfy the expected output. To get input in C++ cin >> variable; where cin means console in.
14th Jan 2021, 2:56 AM
noteve
noteve - avatar
+ 1
Here is the fix 👇 https://code.sololearn.com/cpVFOAMlRT70/?ref=app See 《 Nicko12 》 's answer for details.
14th Jan 2021, 2:57 AM
Arsenic
Arsenic - avatar
+ 1
Wow how did I miss the cin>> Thank you Anytime I input a variable I must use the cin right?
14th Jan 2021, 3:01 AM
Ahadjie Bless
Ahadjie Bless - avatar
+ 1
A simple three lines of code implementation. First, you use the modulus function to find the remainder, which are the passengers on the last bus. Then, to find the empty seats, you use bus capacity minus away the last passengers. https://code.sololearn.com/cAsIKRZH3quK/?ref=app
14th Jan 2021, 4:16 PM
Lam Wei Li
Lam Wei Li - avatar
0
Your attempt is needed
14th Jan 2021, 1:54 AM
Arsenic
Arsenic - avatar
0
#include <iostream> using namespace std; int main() { int passenger = 126; int bus =50; int first = passenger % bus; int second = bus - first; cout <<second<<endl; return 0; }
14th Jan 2021, 2:54 AM
Ahadjie Bless
Ahadjie Bless - avatar
0
Why do i feel like the problem is not solved? Can anyone explain to me what happened in this problem?
7th Sep 2022, 12:38 PM
Liam Dorol
Liam Dorol - avatar
- 1
Always use "cin >>" in C++. Visit :- https://code.sololearn.com/cA96a2994a21 Solution :- #include <iostream> using namespace std; int main() { //your code goes here int input; cin >> input; cout << 50 - input % 50; return 0; }
31st Jul 2021, 12:18 PM
RAJAT AGRAWAL
RAJAT AGRAWAL - avatar