Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import std.stdio;
- int[] addMul(int[] slice, int add, int multiplier)
- {
- int[] result;
- foreach (value; slice) {
- result ~= (value + add) * multiplier;
- }
- return result;
- }
- void main(string[ ] args)
- {
- auto values = [ 1, 2, 3, 4, 5 ];
- writeln(values.addMul(1, 10));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement