Challenge: Write Function that take in an integer R ( greater than 0), and returns a string containing numerical pyramid of R rows.
Function Pyramid(ByVal R as Integer) As String ' Your Code goes here ' End Function
Example outputs
Pyramid of 2
3 1 2
Pyramid of 3
6 3 1
5 2
4
Pyramid of 5
15 10 6 3 1
14 9 5 2
13 8 4
12 7
11
It is also required that all the number in the rows be right aligned in the columns.
So that means the follow output is wrong.
15 10 6 3 1
14 9 5 2
13 8 4
12 7
11
Restrictions
The code must be compiled with the following options turned on.
Option Strict On Option Infer On
When submitting the .net framework version it target should also included.
Scoring
Is the number of count of non white space characters minus the 6 for implicit return statement.
This post has been edited by AdamSpeight2008: 11 February 2011 - 11:00 AM

New Topic/Question
Reply



MultiQuote





|