- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
杨辉三角的多种解法(A variety of solutions of the Yang hui triangle)
杨辉三角的多种解法(A variety of solutions of the Yang hui triangle)
1, 5, 10, 10, 5, 1
1, 6, 15, 20, 15, 6, 1
1 7 21 35 35 21 7 1
1, 8, 28, 56, 70, 56, 28, 8, 1
1 9 36 84 126 126 84 36 9 1
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
So how do you show a pyramid? The question is how to match each number of Spaces before with the line number, so that you can easily when the loop output all output number of Spaces, observe the rule of the ruler in front of the pyramid shape:
The first row I is equal to 0, so 30 is equal to 3 times N minus 3 times 0
Line 2, I = 1 space, 27 = 3 times N minus 3 times 1
The third row I is equal to 2 Spaces and 24 is equal to 3 times N minus 3 times 2
......
Row N I equals I space 3 times N minus 3 times I
According to the above rules, the screen shows the width of the screen, and the number of 1 can only output 13 lines, and then it will not look good.
# include stdio, h
# define N 13
Int main ()
{
Int I;
Int j;
Int a [N] [N].
For (I = 0; I N; I + +)
{
A [0] = 1;
A = 1;
}
For (I = 2; I N; I + +)
For (j = 1; j I; j + +)
A [j] = a [I - 1] [j-1] + a [I - 1] [j]; [j].
For (I = 0; I N; I + +)
{
For (j = 0; j (N * 3-3 * I); j + +)
Printf ( );
For (j = 0; j = I; j + +)
Printf ( % - 6 d , a [j]);
Printf ( \ n );
}
Return 0;
}
Operation result (VC)
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
one
1 1
1 2 1
3 3 1
1, 4, 6, 4, 1
1, 5, 10, 10, 5, 1
1, 6, 15, 20, 15, 6, 1
1 7 21 35 35 21 7 1
1, 8, 28, 56, 70, 56, 28, 8, 1
1 9 36 84 126 126 84 36 9 1
1, 10, 45, 120, 210, 120, 120, 45, 10, 1
1, 11, 55, 165, 462, 462, 462, 555, 11 1
1126220495 792 924 792 495 220 66 12 1
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
There is also a way to whitespace the output in front
您可能关注的文档
- 实干创出新气象(The new weather has been created).doc
- 实现最佳的3G无线网络通话质量_网络_比特网(Achieve the best 3G wireless network call quality _ network _ network).doc
- 实践日志资料(Practical log data).doc
- 宏观经济学试卷(A)标准答案(Macroeconomics paper (A) standard answer).doc
- 实验7 微积分基本运算(Experiment 7).doc
- 实验8.1 指针与数组(Experiment 8.1 pointer and array).doc
- 实验一 单调谐高频小信号放大器(Experiment a single-tuned high-frequency small signal amplifier).doc
- 实验一 数据库的建立和维护(The establishment and maintenance of a database).doc
- 实验一(一) 熔点的测定(毛细管法)(Determination of melting point (capillary method)).doc
- 实验三 三点法测量二端口微波网络的散射参数(The scattering parameters of the two - port microwave network are measured by three - three - point method).doc
- 板木支撑计算(Board support calculation).doc
- 构件吊装工艺(The construction of component crane technology).doc
- 构成概论(An introduction to a).doc
- 林平凡民企招商要顺企业培训应经济发展梯度(Lin ordinary private enterprises to attract enterprises to train should economic development gradient).doc
- 果果贝 让你认识什么是301重定向(What's the 301 redirect).doc
- 枸杞的载重方法(The load method of goji berries).doc
- 枸杞种植技术(Chinese wolfberry planting technology).doc
- 某工程概况(Project overview).doc
- 某水电站2010年晋级考试电气理论试卷(A hydropower station to qualify for the test of electric theory in 2010).doc
- 架构单机神泣(The architecture alone sobs).doc
文档评论(0)