📄 falling.cpp
字号:
// falling.cpp Calculate a victim's altitude each second after a fall // from a given height#include <iostream.h>#include <math.h>const float GRAVITY=32.0;void FallTable (float h){ float time, altitude; time = 0.0; altitude = h; while (altitude > 0.0) { time = time + 1.0; altitude = h - GRAVITY * time * time / 2.0; cout << "time: " << time << " altitude: " << altitude << endl; }}void main(){ float height; cout << "Enter building height: "; cin >> height; FallTable(height); cout << "done." << endl;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -