Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
101802 彭士宝 12自由落体 C++ Compile Error 0 MS 0 KB 413 2024-12-18 21:19:18

Tests(0/0):


Code:

#include <iostream> #include <iomanip> // 用于设置输出精度 using namespace std; int main() { double initialHeight = 100.0; // 初始高度100米 int bounces = 10; // 落地次数 double height = initialHeight / pow(2, bounces - 1); // 计算第10次落地后的反弹高度 cout << fixed << setprecision(6) << height << endl; // 输出结果,保留6位小数 return 0; }


Run Info:

Main.cc: In function 'int main()':
Main.cc:8:55: error: 'pow' was not declared in this scope
     double height = initialHeight / pow(2, bounces - 1); // 计算第10次落地后的反弹高度
                                                       ^