- #include<iostream>
- #define FOR(i,a,b) for(int i=a;i<=b;i++)
- #define ROF(i,a,b) for(int i=a;i>=b;i--)
- using namespace std;
- const int N=105;
- int n,m,num[N][N],z[6]={2,1,0,0,0,0},s[6]={6,6,6,6,5,4},maxx=0,maxy=0;
- char one[10][10]=
- {
- " +---+",
- " / /|",
- "+---+ |",
- "| | +",
- "| |/ ",
- "+---+ ",
- },c[1010][1010];
- void make(int x,int y)
- {
- ROF(i,5,0)
- FOR(j,z[i],s[i])
- {
- c[5-i+x][j+y]=one[i][j];
- maxx=max(maxx,5-i+x);maxy=max(maxy,j+y);
- }
- }
- int main()
- {
- cin>>n>>m;
- FOR(i,1,n)FOR(j,0,m-1)cin>>num[i][j];
- FOR(i,1,n)FOR(j,0,m-1)FOR(k,0,num[i][j]-1)
- make((n-i)*2+1+3*k,(n-i)*2+1+4*j);
- ROF(i,maxx,1)
- {
- FOR(j,1,maxy)
- if(c[i][j]=='\000') cout<<".";
- else cout<<c[i][j];
- cout<<endl;
- }
- return 0;
- }
复制代码 |