⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 falling.cpp

📁 C/C++程序设计导论(第二版)》程序源文件
💻 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 + -