酷代码 AI
菜单

烛龙战队所在的飞船在起飞过程中会加速飞行80秒,每秒钟飞行的距离都会在前一秒的基础上增加10%,已知第一秒的飞行距离为x米。下面请你帮助禾木计算出,飞船在起飞过程中总共飞行的路程。 输入: 一个浮点数,表示飞船在第一秒钟飞行的距离。 输出: 一个浮点数,表示飞船在加速过程中飞行的总路程。 使用c++语言

```cpp #include <iostream> #include <iomanip> #include <cmath> int main() { double x; std::cin >> x; double total = 0.0; double current = x; for (int i = 0; i < 80; i++) { total += current; current *= 1.1; } std::cout << std::fixed << std::setprecision(2) << total << std::endl; return 0; } ``` [2026-02-01 15:08:17 | AI问答 | 109点数解答]

服务商
相关提问
发财导航,免费问AI
实用工具查看更多