Multiplying each element of a list with each element of another list in Scheme programming
问题 i am trying to do the following in Scheme: List<int> list = new List<int>(); List<int> list1 = new List<int>(); List<int> list2 = new List<int>(); list.Add(1); list.Add(2); list.Add(3); list.Add(4); list1.Add(2); list1.Add(4); list1.Add(6); list1.Add(8); for (int i = 0; i < list.Count; i++) { for (int p = 0; p < list1.Count; p++) { list2.Add(list[i] * list1[p]); } } as seen in the code above, I am trying to multiply each element of the first list with every element in the second list. So 1*2,