int main()
{ int a[3][3],b[3][3],c[3][3],d[3][3];
//數組a+數組B結果放入數組c。
//數組a-數組B結果放入數組d。
int i,j;
for(I = 0;我& lt3;I++) //給數組a賦值。
for(j = 0;j & lt3;j++)
scanf("%d ",& ampa[I][j]);
for(I = 0;我& lt3;I++) //給數組b賦值。
for(j = 0;j & lt3;j++)
scanf("%d ",& ampb[I][j]);
Printf("輸出數組a \ n ");
for(I = 0;我& lt3;i++)
{ for(j = 0;j & lt3;j++)
printf("%4d ",a[I][j]);
printf(" \ n ");
}
Printf("輸出數組b \ n ");
for(I = 0;我& lt3;i++)
{ for(j = 0;j & lt3;j++)
printf("%4d ",b[I][j]);
printf(" \ n ");
}
Printf("數組A和數組B相加的結果:\ n ");
for(I = 0;我& lt3;i++)
{ for(j = 0;j & lt3;j++)
{ c[I][j]= a[I][j]+b[I][j];
printf("%4d ",c[I][j]);
}
printf(" \ n ");
}
Printf("數組A和數組B的相減結果:\ n ");
for(I = 0;我& lt3;i++)
{ for(j = 0;j & lt3;j++)
{ c[I][j]= a[I][j]-b[I][j];
printf("%4d ",c[I][j]);}
printf(" \ n ");
}
}