답안 #837310

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
837310 2023-08-25T09:31:03 Z EntityPlantt Bold (COCI21_bold) C++14
50 / 50
0 ms 288 KB
#include <cstdio>
char c[101][101], x;
int n, m, i, j;
int main() {
    scanf("%d%d", &m, &n);
    for (i = 0; i < m; i++) {
        for (j = 0; j < n; j++) {
            scanf(" %c", &x);
            if (x == '#') c[i][j] = c[i + 1][j] = c[i][j + 1] = c[i + 1][j + 1] = '#';
            else if (c[i][j] != '#') c[i][j] = '.';
        }
    }
    for (i = 0; i < m; i++) printf("%s\n", c[i]);
    return 0;
}

Compilation message

bold.cpp: In function 'int main()':
bold.cpp:5:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    5 |     scanf("%d%d", &m, &n);
      |     ~~~~~^~~~~~~~~~~~~~~~
bold.cpp:8:18: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |             scanf(" %c", &x);
      |             ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 0 ms 288 KB Output is correct