package liu0915;
public class Yiweisz {
public static void main(String[] args)
{
//已知2个一维数组:a[]={3,4,5,6,7},b[]={1,2,3,4,5,6,7};把数组a与数组b
//对应的元素乘积再赋值给数组b,如:b[2]=a[2]*b[2];最后输出数组b的元素。
int []a={3,4,5,6,7};
int []b={1,2,3,4,5,6,7};
for( int i=0;i<a.length;i++)
{
b[i]*=a[i];
}
System.out.println("b数组的值是:"+b[0]+" "+b[1]+" "+b[2]+" "+b[3]+" "+b[4]+" "+b[5]+" "+b[6]);
}
}