Using this function,prt_pattern("341","0")
, to print out
0
00
00
000
I'm stuck at converting "341"
into integer and store it each number the following was the result i wanted
array[0] = 3
array[1] = 4
array[2] = 1
The flow I'm going to plan for this function is, convert string into int and store it by character, and then find the highest value. After that using 2 for loop
, 1st for loop is loop from largest number to 1 and 2nd loop is for looping the number if 4 = 4
, print 0
else print " "
and value at array[1] -= 1
.
Hope anyone can help me with this.