---
# System prepended metadata

title: 13559 - Bingo rotation
tags: [array]

---

# 13559 - Bingo rotation
>author: Utin
###### tags: `array`

---

## Brief
See the code below

## Solution 0

```c=
#include<stdio.h>

int main() {
    int n, s[101][101], ans[101][101], a;
    scanf("%d", &n);
    for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
            scanf("%d", &s[i][j]);
        }
    }
    scanf("%d", &a);
    //旋轉次數
    a /= 90;
    //旋轉
    for(int t=0; t<a; t++) {
        for(int i=0; i<n; i++) {
            for(int j=0; j<n; j++) {
                ans[n-1-j][i] = s[i][j];
            }
        }
        for(int i=0; i<n; i++) {
            for(int j=0; j<n; j++) {
                s[i][j] = ans[i][j];
            }
        }
    }
    //輸出
    for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
            printf("%d", s[i][j]);
            if(j != n-1) printf(" ");
        }
        printf("\n");
    }
}
// By Utin
```

## Reference