一个物体从100米的高空自由落下。编写程序,求它在前3秒内下落的垂直距离。设重力加速度为10米/秒 2。
输入格式:
本题目没有输入。
输出格式:
按照下列格式输出
height = 垂直距离值
结果保留2位小数。
代码:
#include<stdio.h> #include<math.h> int main() { int g=10; int t=3; printf("height = %.2lf\n",(double)(g/2*(int)pow(t,2))); }