Home > Back-end >  For help
For help

Time:10-30

Question, this question is whether bosses can teach
#include
Int main () {
Double x, sum, p;
Int n, k;
Lf the scanf (" % % d ", & amp; X, & amp; N);
Sum=x;
P=x/2;
for(k=0; KX=x * 1/2;
};
While (p> 1-5) e {
Sum=sum + 2 * p;
P=p/2;
}
Printf (" %. 6 lf %. 6 lf ", x, sum);
return 0;
}

Subject content: a ball falling from height x m, half rebound after each fall to the ground to jump back to the original height, down again, how high the NTH rebound (0 & lt; NInput: initial height x, rebound number n
Output: the NTH jump height (6 decimal digits) and after the total number of meters (separated with a space between two output), pay attention to the beads for the last time after refers to the total number of meters in height, before after all the path length,
Sample: input: 100
Output: 3.125000 299.999939
 

  • Related