|Online Judge||Problem Set||Authors||Online Contests||User|
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=1The 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.
3 4 6 9 4 5 7 1 5 8 2 6 3 7 8
[Submit] [Go Back] [Status] [Discuss]
Home Page Go Back To top
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator