Nerde Nolzda

ZeroJudge: a015 矩陣的翻轉

ZeroJudge Link (Zh)

#include <stdio.h>

main() {
  int width, height, i, j;
  int arr[100][100];
  while (scanf("%d %d", &width, &height) != EOF) {
    for (i = 0; i < width; i++) {
      for (j = 0; j < height; j++) {
        scanf("%d", &(arr[i][j]));
      }
    }
    for (j = 0; j < height; j++) {
      for (i = 0; i < width; i++) {
        printf("%d ", arr[i][j]);
      }
      printf("\n");
    }
  }
  return 0;
}

Related Posts

0 comments

Post a comment

Send an email to comment@nerde.pw.