tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
17
Task/Pascals-triangle/IDL/pascals-triangle.idl
Normal file
17
Task/Pascals-triangle/IDL/pascals-triangle.idl
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
Pro Pascal, n
|
||||
;n is the number of lines of the triangle to be displayed
|
||||
r=[1]
|
||||
print, r
|
||||
for i=0, (n-2) do begin
|
||||
pascalrow,r
|
||||
endfor
|
||||
End
|
||||
|
||||
Pro PascalRow, r
|
||||
for i=0,(n_elements(r)-2) do begin
|
||||
r[i]=r[i]+r[i+1]
|
||||
endfor
|
||||
r= [1, r]
|
||||
print, r
|
||||
|
||||
End
|
||||
Loading…
Add table
Add a link
Reference in a new issue