Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
20
Task/Floyds-triangle/QBasic/floyds-triangle.basic
Normal file
20
Task/Floyds-triangle/QBasic/floyds-triangle.basic
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
SUB FloydTriangle (fila)
|
||||
DIM numColum(fila)
|
||||
FOR colum = 1 TO fila
|
||||
numColum(colum) = LEN(STR$(colum + fila * (fila - 1) / 2))
|
||||
NEXT colum
|
||||
|
||||
PRINT "output for "; STR$(fila): PRINT
|
||||
thisNum = 1
|
||||
FOR r = 1 TO fila
|
||||
FOR colum = 1 TO r
|
||||
PRINT RIGHT$(" " + STR$(thisNum), numColum(colum)); " ";
|
||||
thisNum = thisNum + 1
|
||||
NEXT colum
|
||||
PRINT
|
||||
NEXT
|
||||
END SUB
|
||||
|
||||
FloydTriangle (5)
|
||||
PRINT
|
||||
FloydTriangle (14)
|
||||
Loading…
Add table
Add a link
Reference in a new issue