Apple and bug problems C ++ and Apple bug problems C
Recently, I have been giving some questions to the students. I thought it would be more concentrated to write the questions.
The problem is as follows:
Apple and bugs:
You bought a box of n apples. Unfortunately, when you buy a box, the box is mixed into a worm. The worm can eat an apple every x hours, assume that the worm will not eat the other one before eating an apple, how many complete good apples will you have after y hours?
Example input: 10 4 9 (indicates a box of 10 apples, one for 4 hours, and a few for 9 hours ?)
Sample output: 7
Code implementation: It should be noted that the value is rounded up, and the default value is rounded down.
The Code is as follows:
# Include
# Include
Using namespace std;
/* Run this program using the console pauser or add your own getch, system ("pause") or input loop */
Int main (int argc, char ** argv ){
Double x, y, n;
Cin> x> y> n;
Cout <
Cout <
Cout <
Return 0;
}