练习2-6 计算物体自由下落的距离 (5 分)

练习2-6 计算物体自由下落的距离 (5 分)

一个物体从100米的高空自由落下。编写程序,求它在前3秒内下落的垂直距离。设重力加速度为10米/秒2​​。

输入格式:

本题目没有输入。

输出格式:

按照下列格式输出

height = 垂直距离值

结果保留2位小数。

 
作者: C课程组
单位: 浙江大学
时间限制: 400 ms
内存限制: 64 MB

#include <stdio.h>
#include <stdlib.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

int main(int argc, char *argv[]) {
float h;
h=0.5*10.0*3.0*3.0;
printf("height = %.2f\n",h);

return 0;
}

猜你喜欢

转载自www.cnblogs.com/xxl-h/p/11110739.html