2018-09-26 13:44:36 +00:00
|
|
|
import java.util.Vector;
|
|
|
|
import java.lang.Integer;
|
|
|
|
|
2019-06-05 08:21:25 +00:00
|
|
|
|
|
|
|
public class VectorAdd {
|
|
|
|
vectorAdd(v1, v2) {
|
|
|
|
var i = 0;
|
2022-12-05 16:22:35 +00:00
|
|
|
v1 = new Vector<Integer>();
|
2019-06-05 08:21:25 +00:00
|
|
|
var erg = new Vector<>();
|
|
|
|
while (i < v1.size()) {
|
|
|
|
erg.addElement(v1.elementAt(i) + v2.elementAt(i));
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
return erg;
|
2019-07-11 13:52:38 +00:00
|
|
|
}
|
2019-06-05 08:21:25 +00:00
|
|
|
}
|