(2018 Multi-University Training Contest 3)Problem L. Visual Cube

时间:2023-03-09 01:21:08
(2018 Multi-University Training Contest 3)Problem L. Visual Cube
 
//题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6330
//题目大意:按照一定格式画出一个 a×b×c 的长方体。 
//解题思路:计算画布大小以及各个关键位置的坐标。按照格式将画布填充正确。逐步覆盖就对了,csy说这是全场最简单的题!虽然我们是第三个做的~
#include <bits/stdc++.h>
using namespace std;
char s[][];
int main()
{
int T;
scanf("%d",&T);
while(T--)
{
int a,b,c;
scanf("%d%d%d",&a,&b,&c);
int m=*b+*a+;
int n=*b+*c+;
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
if(i%==&&j%==)
{
s[i][j]='+';
}
else if(i%==&&j%==)
{
s[i][j]='.';
}
else if(i%==&&j%==)
{
s[i][j]='|';
}
else
{
s[i][j]='/';
}
}
}
for(int i=;i<=*b;i++)
{
for(int j=*b+-i;j>=;j--)
{
s[i][j]='.';
}
}
for(int i=n-*b+;i<=n;i++)
{
for(int j=m-*b++(n-i);j<=m;j++)
{
s[i][j]='.';
}
}
for(int i=;i<=*b;i++)
{
for(int j=*b+-i;j<=m-i;j+=)
if(i%==)
s[i][j]='-';
else
s[i][j]='.';
}
for(int i=*b+;i<=n;i++)
{
for(int j=;j<=*a;j+=)
{
if(i%==)
s[i][j]='-';
else
s[i][j]='.';
}
}
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
cout<<s[i][j];
}
cout<<endl;
}
} }