09-19 11:58
Notice
Recent Posts
Recent Comments
반응형
관리 메뉴

BAN2ARU

CODEUP 1099번 본문

Coding Test/CodeUp

CODEUP 1099번

밴나루 2021. 11. 8. 21:38

https://codeup.kr/problem.php?id=1099

#include <stdio.h>

int main()
{
    int a[11][11] = {};
    int i,j,input,x=2, y=2;
    for(i=1; i<=10; i++)
    {
        for(j=1; j<=10; j++)
        {
            scanf("%d ",&a[i][j]);
        }
        scanf("\n");
    }
    
    while(a[x][y]!=2 && (x<9||y<9))
    {
        if(a[x][y]==0)
        {
            a[x][y]=9;
            y++;
        }
        else if(a[x][y]==1)
        {
            y--;
            x++;
        }
        
    }
    a[x][y]=9;
    
        for(i=1; i<=10; i++)
    {
        for(j=1; j<=10; j++)
        {
            printf("%d ",a[i][j]);
        }
        printf("\n");
    }
}

이로써, C++ 100제 완료!

728x90

'Coding Test > CodeUp' 카테고리의 다른 글

CODEUP 6072번  (0) 2022.03.09
Codeup 6099번  (0) 2021.11.11
CODEUP 6033번  (0) 2021.11.10
CODEUP 1079번  (0) 2021.11.05
CODEUP 1076번  (0) 2021.11.05
Comments