1098번문제
2023. 7. 28. 00:57ㆍ개발 공부/code up 문제
#include <iostream>
#include<stdio.h>
using namespace std;
//1094
int main() {
int j, i,h,w,n,l,d ,x,y;
int map[101][101] = {};
cin >>h>>w;
cin >> n;
for ( i = 1; i <=n; i++)
{
cin >>l>>d>>x>>y ; //l길이 d방향 x 좌표 y좌표
if (d==0) //가로
{
for ( j = 0; j < l; j++)
{
map[x][y+j] = 1;
}
}
else //세로
{
for ( j = 0; j <l; j++)
{
map[x+j][y] = 1;
}
}
}
for (i = 1; i <= h; i++)
{
for (j = 1; j <=w; j++)
{
cout << map[i][j] ;
}
cout << "\n";
}
return 0;
}