Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chinansharon/4a91dfcafce492f8e7378cf351f7a9df to your computer and use it in GitHub Desktop.
Save chinansharon/4a91dfcafce492f8e7378cf351f7a9df to your computer and use it in GitHub Desktop.
ITSA基礎練習題目 題目11. 矩陣反轉
#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