Click here to Skip to main content
15,886,103 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
I am facing an error, that is presentation error.Being a beginner to c++ , i am stucked on a question which listed below:

Two cars (X and Y) leave in the same direction. The car X leaves with a constant speed of 60 km/h and the car Y leaves with a constant speed of 90 km / h.

In one hour (60 minutes) the car Y can get a distance of 30 kilometers from the X car, in other words, it can get away one kilometer for each 2 minutes.

Read the distance (in km) and calculate how long it takes (in minutes) for the car Y to take this distance in relation to the other car.

:::Input:::

30

:::Output::::

60 minutos (minutes in portuguese)

What I have tried:

Now, upon submitting the code it says presentation error. So give a solution ,thanx in advance.

:::::::::::::::Below my code::::::::::

C++
#include <iostream>
using namespace std;

int main(){

int Y;

cin >> Y ; 
cout << 2*Y << " minutos " << endl;

return 2*Y;

}
Posted
Updated 8-Mar-18 21:54pm
v3
Comments
Patrice T 19-Apr-16 23:32pm    
Can you explain exactly what is the problem ?
Philippe Mori 20-Apr-16 10:28am    
You have to get the equations and then it should be trivial to write code...

Your code is correct (but the main function, by convention, should return 0 on success): 'presentation error' is not a C++ error, it looks the contest you are submitting to your program just doesn't like the output.
 
Share this answer
 
What compiler is allowing this thru without an error
C++
#include
????? really gets thru your compiler .. I am stunned

I would fail you outright just for submitting that line of code

Probably begs the question have you actually compiled your code?
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900