Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
79979 sh25_huangse 人口增长 C++ 通过 0 MS 244 KB 424 2026-01-04 14:54:30

Tests(1/1):


#include <iostream> #include <iomanip> // 用于格式化输出 using namespace std; int main() { int x, n; cin >> x >> n; double population = x; // 使用double进行浮点计算 for (int i = 0; i < n; i++) { population *= 1.001; // 每年增长0.1%,即乘以1.001 } // 保留4位小数输出 cout << fixed << setprecision(4) << population << endl; return 0; }


测评信息: