3 Star 13 Fork 2

比特鹏哥/算法竞赛-C++编程课

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.cpp 244 Bytes
一键复制 编辑 原始数据 按行查看 历史
#include <iostream>
#include <cstdio>
using namespace std;
int main()
{
int n;
double x;
double sum = 1; //ʼΪ1
double r = 1;
cin >> x >> n;
while(n--) //nѯ
{
r *= x;
sum += r;
}
printf("%.2f\n", sum);
return 0;
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/bitpg/algorithm-competition-cpp.git
git@gitee.com:bitpg/algorithm-competition-cpp.git
bitpg
algorithm-competition-cpp
算法竞赛-C++编程课
master

搜索帮助