当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

3173:Parkside's Triangle

题目描述
Bessie taught the cows to make Parkside's Triangle. It is generated from two numbers: the size and the seed. The size N (1 <= N <= 20) determines how many rows are in the triangle and the seed S (1 <= S <= 9) determines the first number in the triangle. Here are two examples:

 N=5, S=3                  N=6, S=1  


3 4 6 9 4 1 2 4 7 2 7
5 7 1 5 3 5 8 3 8
8 2 6 6 9 4 9
3 7 1 5 1
8 6 2
3
The first line of any triangle has no blanks at its front.

Analyze the above examples, discover the rule, and write a program that will generate Parkside's Triangle given any size N (1 <= N <= 20) and any seed S (1 <= S <= 9).
输入解释
Line 1: Two space-separated integers: N and S
输出解释
Lines 1..N: Parkside's Triangle as above; no trailing blanks on any line.
输入样例
5 3
输出样例
3 4 6 9 4
  5 7 1 5
    8 2 6
      3 7
        8

该题目是Virtual Judge题目,来自 北京大学POJ

源链接: POJ-3173

最后修改于 2020-10-29T06:54:49+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
1000 65536