SDJ( 수돈재 아님 ㅎ )

[C] 13240 - Chessboard 본문

알고리즘/Backjoon

[C] 13240 - Chessboard

ShinDongJun 2019. 12. 3. 15:25

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

 

13240번: Chessboard

A single line with two integers N and M separated by spaces. The number N will represent the number of rows and M the number of columns. N and M will be between 1 and 10.

www.acmicpc.net

 

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
 
int main(void)
{
    int n, m;
    scanf("%d %d"&n, &m);
 
    for(int i = 0; i < n; ++i)
    {
        for(int j = 0;j < m; ++j)
        {
            if((i^j)&1printf(".");
            else printf("*");
        }
        printf("\n");
    }
 
    return 0;
}

'알고리즘 > Backjoon' 카테고리의 다른 글

[C] 3085 - 사탕 게임  (0) 2019.12.04
[C++] 2748 - 피보나치 수 2  (0) 2019.12.04
[C] 13241 - 최소공배수  (0) 2019.12.03
[C++] 1065 - 한수  (0) 2019.11.24
[C] 17952 - 과제는 끝나지 않아!  (0) 2019.11.23
Comments