Current location - Training Enrollment Network - Mathematics courses - Mathematical program box program
Mathematical program box program
I didn't want to answer because someone had already answered, but I found that the answer upstairs was wrong. Let's give an answer.

# include & ltstdio.h & gt

# include & ltmath.h & gt

Master ()

{

Floating point x, p;

Printf ("Please enter the distance (km):");

scanf("%f ",& ampx);

p =(x-5)/5;

p =(x & gt; 5? ceil(p):0);

Printf ("price payable: %3f\n", p);

}

You can also take X here as the number of stops, because one stop is 1 km.