tag:blogger.com,1999:blog-6314876008291942531.post1605802753045549054..comments2024-01-14T00:36:43.430-08:00Comments on Antonio Gulli's coding playground: Given an array of integers, populate another array with the product of the elements of the first array except for the current index element.Unknownnoreply@blogger.comBlogger1125tag:blogger.com,1999:blog-6314876008291942531.post-31352600568508840142013-03-20T16:00:23.248-07:002013-03-20T16:00:23.248-07:00int prod = 0;
foreach(int i : vector) prod *= i;
...int prod = 0;<br />foreach(int i : vector) prod *= i;<br /><br />for (int idx = 0; idx < N; ++idx) {<br /> vector[idx] = prod/vector[idx];<br />}D.asiahttps://www.blogger.com/profile/12469151554753914922noreply@blogger.com