Java - Output the product of all three integers between 4 unequal integers
阿神
阿神 2017-05-17 10:00:37
0
1
668

Write a program in Java to output the product of any three integers between 4 unequal integers.
For example, input 1,7,3,4
calculation process:
734,134,174 ,173
Output: 84,12,28,21

阿神
阿神

闭关修行中......

reply all(1)
仅有的幸福
int[] arr = {1,4,3,7};
for(int i = 0;i< arr.length;i++){
   int num = 1;
   for(int j= 0; j<arr.length;j++){
       if(i!=j){
          num = num * arr[j];
       }
   }

   System.out.println(num);
}
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template