Anonymous user
Floyd's triangle: Difference between revisions
→{{header|PARI/GP}}
Not a robot (talk | contribs) (Add CLU) |
|||
Line 4,260:
{{incorrect|PARI/GP|It does not ensure that there is exactly one space between the columns in the last row.}}
<lang parigp>
lastrowe=m*(m+1)/2;lastrowa=lastrowe+1-m;lastrowlen=m;
vecfieldlen=vector(lastrowlen);
F(14)</lang>▼
for(k=1,m,fl[k]=1+#Str(k-1+lastrowa));
il=1; printf(Str("%" fl[1]-1 "d"),il);print();
for(i=2,m,
for(j=1,i,
il++;
printf(Str("%" fl[j]-(il==1) "d"),il)
);
print()
);
return()}
floyd(5)
floyd(14)
{{out}}
<pre>
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
</pre>
=={{header|Pascal}}==
|