0
How is my code wrong ? Even when its matching with expected results
6 ответов
+ 2
You are not supposed to print anything except y variable
+ 2
Adi
Hi
First of all you actually can calculate with only one line:
result = 50 - ( x % 50);
Where x is input number.
And SoloLearn input and output should be without any message, meaning:
cin >> x;
cout << result;
Good luck
+ 1
Copy your code and paste it here
0
It might have to do with spacing or the way it was given, however we cant see the code with the link you gave.
Would you add the code to your question?
0
No, copy your code and send it to me
0
#include <iostream>
using namespace std;
int main() {
//your code goes here
int x,y,z;
cout<<"enter num of passenger waiting \n";
cin>>x;
z=x;
x=x/50;
z=z-(x*50);
y= 50-z;
cout<<"seats left: "<< y <<endl;
return 0;
}