#include<stdio.h>
int main() {
float t = 3.00;
float g = 10.00;
float height;
height = 0.5 * g * t * t;//不能写成height=1/2*g*t*t,因为1/2=0;
printf("height = %.2f", height);//保留两位小数,所以用%.2f;
return 0;
}
pta编程题练习2-6 计算物体自由下落的距离 (5 分)
最新推荐文章于 2023-10-09 12:11:33 发布