![](https://iknow-base.cdn.bcebos.com/lxb/notice.png)
C++帮忙解释一下题目
ProblemDescriptionInthisproblem,youareaskedtogeneratePascal'sTriangle.Pascal'sTriangl...
Problem Description
In this problem, you are asked to generate Pascal's Triangle.
Pascal's Triangle is useful in many areas from probability to polynomials to
programming contests. It is a triangle of integers with ``1'' on top and down
the sides. Any number in the interior equals the sum of the two numbers above
it. For example, here are the first 5 rows of the triangle.1 1 1 1 2 1 1 3 3 1 1
4 6 4 1
In ``Pascal's Triangle of Death,'' you are to generate a left
justified Pascal's Triangle. When any number in the triangle is exceeds or
equals 1060, your program should finish printing the current row and exit. The
output should have each row of the triangle on a separate line with one space
between each element.
The final element of each line should be directly
followed by a newline. There is no space after the last number on each line.
Input
No
Sample Input
There is no input for this problem.
Sample Output
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
.
.
. 展开
In this problem, you are asked to generate Pascal's Triangle.
Pascal's Triangle is useful in many areas from probability to polynomials to
programming contests. It is a triangle of integers with ``1'' on top and down
the sides. Any number in the interior equals the sum of the two numbers above
it. For example, here are the first 5 rows of the triangle.1 1 1 1 2 1 1 3 3 1 1
4 6 4 1
In ``Pascal's Triangle of Death,'' you are to generate a left
justified Pascal's Triangle. When any number in the triangle is exceeds or
equals 1060, your program should finish printing the current row and exit. The
output should have each row of the triangle on a separate line with one space
between each element.
The final element of each line should be directly
followed by a newline. There is no space after the last number on each line.
Input
No
Sample Input
There is no input for this problem.
Sample Output
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
.
.
. 展开
3个回答
展开全部
In ``Pascal's Triangle of Death,'' you are to generate a leftjustified Pascal's Triangle.
在 "Pascal三角死亡"问题中, 你将产生一个靠左对齐的Pascal三角形.
When any number in the triangle is exceeds or equals 1060,
当三角形中的任何数>=1060时,
your program should finish printing the current row and exit.
你的程序应停止印出目前的行并结束.
The output should have each row of the triangle on a separate line with one space
between each element.
三角形中的各行应各印一行, 其中各数之间要有一个空格.
The final element of each line should be directly followed by a newline. There is no space after the last number on each line.
各行末端直接印换行符号, 不要有空格.
在 "Pascal三角死亡"问题中, 你将产生一个靠左对齐的Pascal三角形.
When any number in the triangle is exceeds or equals 1060,
当三角形中的任何数>=1060时,
your program should finish printing the current row and exit.
你的程序应停止印出目前的行并结束.
The output should have each row of the triangle on a separate line with one space
between each element.
三角形中的各行应各印一行, 其中各数之间要有一个空格.
The final element of each line should be directly followed by a newline. There is no space after the last number on each line.
各行末端直接印换行符号, 不要有空格.
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
2012-08-24
展开全部
问题描述
在这个问题上,你要求产生帕斯卡三角形。
帕斯卡的三角是有用的,在许多地区从概率多项式
编程竞赛。这是一个三角形的整数“1”的顶部和下降
的两侧。在室内的任何数目等于上述的两个数字的总和
它。例如,这里的第5行的triangle.111 12 11 33 1 1
4 6 4 1
在``Pascal的死亡三角,“你是来生成左
合理的帕斯卡三角形。当三角形的任何数字是超过或
等于1060,你的程序应该完成打印当前行和退出。“
输出应该有一个单独的行中的每一行上的三角形与一个空格
每个元素之间。
每行的最后一个元件,应直接
后跟一个换行符。没有足够的空间后,最后一个数字在每一行。
输入
没有
样例输入
这个问题有没有输入。
样本输出
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
.
.
.
在这个问题上,你要求产生帕斯卡三角形。
帕斯卡的三角是有用的,在许多地区从概率多项式
编程竞赛。这是一个三角形的整数“1”的顶部和下降
的两侧。在室内的任何数目等于上述的两个数字的总和
它。例如,这里的第5行的triangle.111 12 11 33 1 1
4 6 4 1
在``Pascal的死亡三角,“你是来生成左
合理的帕斯卡三角形。当三角形的任何数字是超过或
等于1060,你的程序应该完成打印当前行和退出。“
输出应该有一个单独的行中的每一行上的三角形与一个空格
每个元素之间。
每行的最后一个元件,应直接
后跟一个换行符。没有足够的空间后,最后一个数字在每一行。
输入
没有
样例输入
这个问题有没有输入。
样本输出
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
.
.
.
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
就是让你写一个程序打印杨辉三角
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询