List comprehensions: Difference between revisions

Content added Content deleted
m (Fixed lang tags (using MediaWiki::API).)
Line 43: Line 43:


=={{header|C++}}==
=={{header|C++}}==
There is no equivalent construct in C++. The code below uses three nested loops and an ''if'' statement:

<lang cpp>#include <vector>
<lang cpp>#include <vector>
#include <cmath>
#include <cmath>
Line 74: Line 76:
}
}
}
}
</lang>

This produces the following output:
This produces the following output:
3 4 5 5 12 13 6 8 10 8 15 17 9 12 15 12 16 20</lang>
'''3 4 5 5 12 13 6 8 10 8 15 17 9 12 15 12 16 20'''


=={{header|Clojure}}==
=={{header|Clojure}}==