Processing math: 100%

페이지

10995번: 별 찍기 - 20

https://www.acmicpc.net/problem/10995


O(n^2)


#include<cstdio>
int n;
int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) printf(i & 1 ? " *" : "* ");
        puts("");
    }
    return 0;
}

댓글 없음 :

댓글 쓰기