Advertisement
KuoHsiangYu

白羽優莉奈_方法一.c

Jan 2nd, 2019
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.50 KB | None | 0 0
  1. //https://www.facebook.com/xiangyu.guo1/posts/2425696817458525
  2.  
  3. #include <stdio.h>
  4.  
  5. #define X 2
  6. #define Y 2
  7.  
  8. /*
  9. 注意你這邊得這樣把陣列大小寫進去,不能寫 a** 或 a[][] 或 *a[]
  10. */
  11. void print_array(int a[X][Y]) {
  12.     for (int i = 0; i < X; i++) {
  13.         for (int j = 0; j < Y; j++) {
  14.             printf("%d, ", a[i][j]);
  15.         }
  16.         printf("\n");
  17.     }
  18. }
  19.  
  20. int main() {
  21.     int a[X][Y] = {{0, 1},
  22.                    {2, 3}};
  23.     print_array(a);
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement