Display a linear combination: Difference between revisions
Content deleted Content added
Alextretyak (talk | contribs) Added 11l |
Alextretyak (talk | contribs) |
||
Line 39:
{{trans|Python}}
<lang 11l>F linear(x)
V a = enumerate(x).filter2((i, v) -> v != 0).map((i, v) -> ‘#.e(#.0)’.format(I v == -1 {‘-’} E I v == 1 {‘’} E String(v)‘*’, i + 1))
R (I !a.empty {a} E [String(‘0’)]).join(‘ + ’).replace(‘ + -’, ‘ - ’)
|