博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
方幂序列 c+~+_C ++程序查找序列1 + x + x ^ 2 +……+ x ^ n的和
阅读量:2509 次
发布时间:2019-05-11

本文共 582 字,大约阅读时间需要 1 分钟。

方幂序列 c+~+

#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{


clrscr(); //to clear the screen
long i,n,x,sum=1;

cout<<“1+x+x^2+……+x^n”;
cout<<“nnEnter the value of x and n:”;
cin>>x>>n;

for(i=1;i<=n;++i)
sum+=pow(x,i);
cout<<“nSum=”<<sum;
getch(); //to stop the screen
}

#include<iostream.h>
#include<conio.h>
#include<math.h>

void main()
{


clrscr(); //to clear the screen
long i,n,x,sum=1;

cout<<“1+x+x^2+……+x^n”;
cout<<“nnEnter the value of x and n:”;
cin>>x>>n;

for(i=1;i<=n;++i)
sum+=pow(x,i);
cout<<“nSum=”<<sum;
getch(); //to stop the screen
}

翻译自:

方幂序列 c+~+

转载地址:http://lrwwd.baihongyu.com/

你可能感兴趣的文章
Java基础回顾 —I/O
查看>>
解决 samba不允许一个用户使用一个以上用户名与一个服务器或共享资源的多重连接...
查看>>
css3选择器-边框-阴影效果
查看>>
C语言中short的意思
查看>>
Window phone8中pdf文件预览
查看>>
产生冠军 map 的 应用 .
查看>>
Xcode4快速Doxygen文档注释 — 简明图文教程
查看>>
源代码里面看不到页面展示的数据?原因何在
查看>>
Oracle SQL高级编程
查看>>
点到线段的最短距离
查看>>
爬虫:mac系统下——chromedriver安装问题解决方法
查看>>
2734: [HNOI2012]集合选数 - BZOJ
查看>>
Apple - Hdu5160
查看>>
测试经验总结(“二次开发”)
查看>>
洛谷1462通往奥格瑞玛的道路
查看>>
bzoj 3110 [Zjoi2013]K大数查询——线段树套线段树(标记永久化)
查看>>
Arduino - ( Uno、Nano、Promini)针脚示意图
查看>>
201621123030《Java程序设计》第11周学习总结
查看>>
js scroll 滚动连续多次触发事件只执行一次
查看>>
sk_buff Structure
查看>>