首页 > 代码库 > D - X and paintings

D - X and paintings

 1 //模拟题
 2 #include <bits/stdc++.h>
 3 using namespace std;
 4 char ma[250][250];
 5 int main()
 6 {
 7     int n;
 8     scanf("%d",&n);
 9     while(n--)
10     {
11         memset(ma,.,sizeof(ma));
12         int x,y,m;
13         scanf("%d%d%d",&x,&y,&m);
14         int x1,x2,y1,y2;
15         char c;
16         for(int t=0;t<m;t++)
17         {
18             scanf("%d %d %d %d %c",&x1,&y1,&x2,&y2,&c);
19             for(int i=x1;i<=x2;i++)
20                 for(int j=y1;j<=y2;j++)
21                 ma[i][j]=c;
22         }
23         for(int i=1;i<=x;i++)
24         {
25             for(int j=1;j<=y;j++)
26                 printf("%c",ma[i][j]);
27             printf("\n");
28         }
29     }
30 }

 

D - X and paintings