????????????????int?sum?=?10000;
int[]?price?=?{690,1500,2100,1740,2140,2080};
int?a=0,b=0,c=0,d=0,e=0,f=0;
int?time=0;
for(int?i=0;i<price.length;i++)
{
?a=price[i];
for(int?j=0;j<price.length;j++)
{
?b=price[j];
for(int?k=0;k<price.length;k++)
{
?c=price[k];
for(int?l=0;l<price.length;l++)
{
?d=price[l];
for(int?m=0;m<price.length;m++)
{
?e=price[m];
for(int?n=0;n<price.length;n++)
{
?f=price[n];
sum?=?a+b+c+d+e+f;
if(sum<=10000)
{
time++;
System.out.println(a+"+"+b+"+"+c+"+"+d+"+"+e+"+"+f+"總花費:"+sum+"購買方式:"+time+"種");
sum=0;
}
}
}
}
}
}
}
添加回答
舉報
0/150
提交
取消