System.out.println("Apple="+a+" "+"Pear="+p+" "+"Cherry="
+c+" "+"Watermelon="+w+" "+"Grape="+g);
}
int[] in ={a,p,c,w,g};
int max,temp=0;
max = temp;
for(int i=0;i<5;i++)
{
temp = in[i];
if(temp > max)
max = temp;
}
System.out.println(max);
怎样输出a,p…这些变量对应的名字?
添加回答
举报
0/150
提交
取消