- 1
What am I doing wrong for this project 11 transportation?
#include <iostream> using namespace std; int main() { //your code goes here cout<<"input"; int input; cin>>input; cout<<"result:"<<input % 50; return 0; }
2 ответов
0
Calculate how many EMPTY seats are on the last bus. Your calculation shows how many passengers (i.e., used seats) are on the last bus.
Don't print extra text in the input and output. Code Coach is an unforgiving computer. You must follow its instructions exactly. Make your output match the examples perfectly.
0
You don't have to print out words, only the answer is needed.
Also, as Brian rightly said, your code prints out the number of seats occupied by passengers instead of the number of empty seats as required.
Here is how I did it
#include <iostream>
Using namespace std;
Int main() {
int num1;
cin >> num1;
int lastPeople = num1 % 50;
int num2 = 50 - lastPeople;
Cout << num2 ;
return 0;
}