Lua program | SoloLearn: Learn to code for FREE!

+1

Lua program

Given a number NN, generate a star pattern such that on the first line there are NNstars and on the subsequent lines the number of stars decreases by 1. The pattern generated should have NN rows. In every row, every fifth star (*) is replaced with a hash (#). Every row should have the required number of stars (*) and hash (#) symbols. The code stub provided here is to be used. It calls the function generatePattern(). Your task is to complete the function. Input: First line will contain TT, number of testcases. Then the testcases follow. Each testcase contains a single integer NN Output: For each testcase, print the star and hash pattern. Constraints 1≤T≤251≤T≤25 1≤N≤1001≤N≤100 Subtasks Subtask #1 (40 points): N≤15N≤15 Subtask #2 (60 points): original constraints

10/18/2020 3:14:37 PM

Kangude Harshada Bhimraj

1 Answer

New Answer

+1

Not many Lua programmers on Sololearn