---
# System prepended metadata

title: Week 5

---

# Week 5

## 팀미션

### 1번
```c
// Olaf
#include <stdio.h>

#define column 6
#define row 5

int main(void) {
    int arr[column][row] = {
        { 1,  2,  3,  4,  5},
        { 6,  7,  8,  9, 10},
        {11, 12, 13, 14, 15},
        {16, 17, 18, 19, 20},
        {21, 22, 23, 24, 25},
        {26, 27, 28, 29, 30}
    };
    
    for (int c = 0 ; c < column; c++) {
        for (int r = 0; r < row; r++) {
            printf("%2d ", *(*(arr + c) + r));
        }
        printf("\n");
    }
}
```

```c
// jinie
#include <stdio.h>

int main()
{
    int arr[6][5] = {{1, 2, 3, 4, 5}, {6, 7, 8, 9, 10}, {11, 12, 13, 14, 15}, 
                    {16, 17, 18, 19, 20}, {21, 22, 23, 24, 25}, {26, 27, 28, 29, 30}};
    int n0 = sizeof(arr)/sizeof(arr[0]);
    int n1 = sizeof(arr[0])/sizeof(int);

    for(int i=0; i<n0; i++) {
        for(int j=0; j<n1; j++) {
            printf("%d\t", *(*(arr+i)+j));
        }
        printf("\n");
    }
}
```

### 3번
``` c
// Olaf
#include <stdio.h>

void sort(int, int*);

int main(void) {
    int n = 7;
    int arr[7] = { 0, 25, 10, 17, 6, 12, 9 };
    sort(n, arr);
    return 0;
}

void sort(int size, int* arr) {
    for(int i = 0; i < size; i++) {
        for(int j = i; j < size; j++) {
            if (*(arr + i) > *(arr + j)) {
                int temp = *(arr + j);
                *(arr + j) = *(arr + i);
                *(arr + i) = temp;
            }
        }
    }
}
```
