Closed justonlyasy closed 3 years ago
If you fix the syntax error, you will get the correct output:
`// This function sums its arguments. real sum(... real[][] nums) { real total=0; for(int i=0; i < nums.length; ++i) total += sum(nums[i]); return total; }
write(sum(... new real[][]{{1,2},{3,4}})); // outputs: 10 write(sum(new real[] {1,2}, new real[] {3,4})); // outputs: 10 `
Check it,