# C語言題庫-076 將二維數組行列元素互換,存到另一個數組中。 【參考答案】 ``` #include <stdio.h> main() { int a [2][3]={{1,2,3},{4,5,6}}; int b[3][2],i,j; printf(“array a :\n”); for(i=0;i<=1;i++) { for(j=0;j<=2;j++) { printf("%5d",a[i][j]); b[j][i]=a[i][j]; } printf("\n"); } printf(“array b :\n”); for(i=0;i<=2;i++) { for(j=0;j<=1;j++) printf("%5d",b[i][j]); printf("\n"); } } ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up