Jump to content

Append numbers at same position in strings: Difference between revisions

m
rm commentary based on updated task description
(→‎{{header|Wren}}: Updated in line with task description.)
m (rm commentary based on updated task description)
Line 34:
 
=={{header|FreeBASIC}}==
I'm assuming the requirement to show the list twice is a typo, so I show it only once.
<lang freebasic>dim as integer list1(1 to 9) = {1,2,3,4,5,6,7,8,9}
dim as integer list2(1 to 9) = {10,11,12,13,14,15,16,17,18}
Line 102 ⟶ 101:
var list3 = (19..27).toList
var list = (0..8).map { |i| 1e4*list1[i] + 100*list2[i] + list3[i] }.toList
System.print("%(list)%(list)")</lang>
 
{{out}}
<pre>
[11019, 21120, 31221, 41322, 51423, 61524, 71625, 81726, 91827][11019, 21120, 31221, 41322, 51423, 61524, 71625, 81726, 91827]
</pre>
781

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.