| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Что делает:
Перемножает все элементы массива (вычисляет произведение).
Код:
public class ProductOfArray {
public static void main(String[] args) {
int[] str = {1, 2, 3, 4, 5};
System.out.println(massiv(str));
}
public static int massiv(int[] str) {
int res = 1;
for (int i = 0; i < str.length; i++) {
res *= str[i];
}
return res;
}
}120
| Back | FazBrowse Home | New Git URL |