Loop over multiple arrays simultaneously: Difference between revisions
Content deleted Content added
Added PHP implementation |
No edit summary |
||
Line 114: | Line 114: | ||
return 0; |
return 0; |
||
}</lang> |
}</lang> |
||
=={{header|C sharp|C#}}== |
|||
<lang csharp> |
|||
class Program |
|||
{ |
|||
static void Main(string[] args) |
|||
{ |
|||
char[] a = { 'a', 'b', 'c' }; |
|||
char[] b = { 'A', 'B', 'C' }; |
|||
int[] c = { 1, 2, 3 }; |
|||
int min = Math.Min(a.Length, b.Length); |
|||
min = Math.Min(min, c.Length); |
|||
for (int i = 0; i < min; i++) |
|||
{ |
|||
Console.WriteLine("{0}{1}{2}", a[i], b[i], c[i]); |
|||
} |
|||
Console.ReadLine(); |
|||
} |
|||
} |
|||
</lang> |
|||
=={{header|Clojure}}== |
=={{header|Clojure}}== |
||
<lang lisp>(doseq [s (map #(str %1 %2 %3) "abc" "ABC" "123")] |
<lang lisp>(doseq [s (map #(str %1 %2 %3) "abc" "ABC" "123")] |