1085:球弹跳高度的计算

#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    double a,b,n=2;
int h;
scanf("%d",&h);
a=h;
b=h/2.0;
while(n<=10)
{
a=a+2*b;
b=(1.0/2)*b;
n++;
}
printf("%g\n%g",a,b);
return 0;
}100'

猜你喜欢

转载自blog.csdn.net/qq_42552468/article/details/80863518
今日推荐