Java tutorial
//package com.java2s; //License from project: Apache License public class Main { public static long productOfDigit(int[] digits) { long result = 1; for (int i = 9; i >= 0; i--) { if (digits[i] != 0) { result *= Math.pow(i, digits[i]); } } return result; } }