Given 6 integers and 1 target value, write a function to get the target value using 6 integers with any on these operations ,*,-,/
<p>Given 6 integers and 1 target value, write a function to get the target value using 6 integers with any on these operations +,*,-,/ </p>

<p>This is what I did</p>

<pre><code>public class Solution {
    public static void main(String[] args) {

int target =5;
int a[]={1,3,2,10,15,8};
int i,j;

for(j=0;j&lt;6;j++)
for(i=0;i&lt;6;i++)
    if(a[i]/a[j]==target)       System.out.println(a[i]+"/"+a[j]+"="+target);

for(j=0;j&lt;6;j++)
for(i=0;i&lt;6;i++)
    if(a[i]+a[j]==target)       System.out.println(a[i]+"+"+a[j]+"="+target);   


for(j=0;j&lt;6;j++)
for(i=0;i&lt;6;i++)
    if(a[i]*a[j]==target)       System.out.println(a[i]+"*"+a[j]+"="+target);

for(j=0;j&lt;6;j++)
for(i=0;i&lt;6;i++)
    if(a[i]-a[j]==target)       System.out.println(a[i]+"-"+a[j]+"="+target);

    }
}
</code></pre>

<p>I know this is wrong because I'm just using 1 operation at a time, what can I do to do multiple operations at once. For example, if it were a complex array like {45, 4, 84, 63, 91, 20, 400} and my target value was 455 which is (91*20)/4, then how can my program do that? How can it try all possible operations?</p>
