Created
November 30, 2016 17:22
-
-
Save chinansharon/4a91dfcafce492f8e7378cf351f7a9df to your computer and use it in GitHub Desktop.
ITSA基礎練習題目 題目11. 矩陣反轉
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
int main(){ | |
int a,b,count; | |
scanf("%d%d",&a,&b); | |
int box[a*b]; | |
for(int i=0;i<(a*b);i++){ | |
scanf("%d",&box[i]); | |
} | |
for(int y=0;y<b;y++){ | |
for(int x=0;x<a;x++){ | |
count++; | |
printf("%d",box[x*b+y]); | |
if(count%a!=0){ | |
printf(" "); | |
} | |
} | |
printf("\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment