### 思路  

按要求打印方块

  注意考虑边界棱的问题
  宽和高的差值可能为负数(这里分了b-c>=0和b-c< 0两种情况,分开画)

### 代码

  1 #include <bits/stdc++.h>
2 #include <iostream>
3 #include <cstring>
4 #include <stack>
5 #include <cstdlib>
6 #include <queue>
7 #include <cmath>
8 #include <cstdio>
9 #include <algorithm>
10 #include <string>
11 #include <vector>
12 #include <list>
13 #include <iterator>
14 #include <set>
15 #include <map>
16 #include <utility>
17 #include <iomanip>
18 #include <ctime>
19 #include <sstream>
20 #include <bitset>
21 #include <deque>
22 #include <limits>
23 #include <numeric>
24 #include <functional>
25
26 #define gc getchar()
27 #define mem(a) memset(a,0,sizeof(a))
28 #define mod 1000000007
29 #define sort(a,n,int) sort(a,a+n,less<int>())
30 #define fread() freopen("in.in","r",stdin)
31 #define fwrite() freopen("out.out","w",stdout)
32 using namespace std;
33
34 typedef long long ll;
35 typedef char ch;
36 typedef double db;
37
38 const int maxn=1e5+10;
39 //ll a[maxn];
40 int aa[maxn];
41
42 int main()
43 {
44 int t;
45 cin>>t;
46 while(t--)
47 {
48 int a , b , c;
49 cin>>a>>b>>c;
50 if(c>b)
51 {
52
53 for(int i = 0;i<2*b;i++)
54 {
55 for(int j = 0;j<2*b-i;j++)
56 cout<<'.';
57 if(i%2)
58 {
59 for(int j = 0;j <a;j++)
60 {
61 cout<<"/.";
62 }
63 cout<<'/';
64 }
65 else
66 {
67 for(int j = 0;j <a;j++)
68 {
69 cout<<"+-";
70 }
71 cout<<'+';
72 }
73 for(int j = 0;j<i/2;j++)
74 {
75 if(i%2)
76 cout<<"|/";
77 else
78 cout<<".+";
79 }
80 if(i%2)
81 cout<<'|';
82
83 cout<<endl;
84 }
85 for(int i = 0;i<(c-b)*2;i++)
86 {
87 if(i%2)
88 {
89 for(int j = 0;j<a;j++)
90 cout<<"|.";
91 cout<<'|';
92 for(int j = 0;j<b;j++)
93 cout<<"/|";
94 }
95 else
96 {
97 for(int j = 0;j<a;j++)
98 cout<<"+-";
99 cout<<'+';
100 for(int j = 0;j<b;j++)
101 cout<<".+";
102 }
103 cout<<endl;
104 }
105 for(int i = 0;i<2*b+1;i++)
106 {
107 if(i%2)
108 {
109 for(int j = 0;j<a;j++)
110 cout<<"|.";
111 cout<<'|';
112 for(int j = 0;j<(2*b-i-1)/2;j++)
113 cout<<"/|";
114 cout<<'/';
115 }
116 else
117 {
118 for(int j = 0;j<a;j++)
119 cout<<"+-";
120 cout<<'+';
121 for(int j = 0;j<(2*b-i)/2;j++)
122 cout<<".+";
123 }
124 for(int j = 0;j<i;j++)
125 cout<<'.';
126 cout<<endl;
127 }
128
129 }
130 else
131 {
132
133 for(int i = 0;i<2*c;i++)
134 {
135 for(int j = 0;j<2*b-i;j++)
136 cout<<'.';
137 if(i%2)
138 {
139 for(int j = 0;j <a;j++)
140 {
141 cout<<"/.";
142 }
143 for(int j = 0;j <i/2+1;j++)
144 {
145 cout<<"/|";
146 }
147 }
148 else
149 {
150 for(int j = 0;j <a;j++)
151 {
152 cout<<"+-";
153 }
154 cout<<'+';
155 for(int j = 0;j <i/2;j++)
156 {
157 cout<<".+";
158 }
159 }
160 cout<<endl;
161 }
162 for(int i = 0;i<(b-c)*2;i++)
163 {
164 for(int j = 2*c;j<2*b-i;j++)
165 cout<<'.';
166 if(i%2)
167 {
168 for(int j = 0;j <a;j++)
169 {
170 cout<<"/.";
171 }
172 for(int j = 0;j <c;j++)
173 {
174 cout<<"/|";
175 }
176 cout<<'/';
177 }
178 else
179 {
180 for(int j = 0;j <a;j++)
181 {
182 cout<<"+-";
183 }
184 cout<<'+';
185 for(int j = 0;j <c;j++)
186 {
187 cout<<".+";
188 }
189 }
190 for(int j = 0;j<i;j++)
191 {
192 cout<<'.';
193 }
194 cout<<endl;
195 }
196 for(int i = 0;i<2*c+1;i++)
197 {
198 if(i%2)
199 {
200 for(int j = 0;j <a;j++)
201 {
202 cout<<"|.";
203 }
204 cout<<'|';
205 for(int j = 0;j <(2*c-i)/2;j++)
206 {
207 cout<<"/|";
208 }
209 cout<<'/';
210 }
211 else
212 {
213 for(int j = 0;j <a;j++)
214 {
215 cout<<"+-";
216 }
217 cout<<'+';
218 for(int j = 0;j <(2*c-i)/2;j++)
219 {
220 cout<<".+";
221 }
222 }
223 for(int j = 0;j<2*b-2*c+i;j++)
224 cout<<'.';
225
226 cout<<endl;
227 }
228
229 }
230 }
231 }

L - Problem L. Visual Cube HDU - 6330的更多相关文章

  1. HDU 6330.Problem L. Visual Cube-模拟到上天-输出立方体 (2018 Multi-University Training Contest 3 1012)

    6330.Problem L. Visual Cube 这个题就是输出立方体.当时写完怎么都不过,后来输出b<c的情况,发现这里写挫了,判断失误.加了点东西就过了,mdzz... 代码: //1 ...

  2. HDU 多校对抗第三场 L Visual Cube

    Problem L. Visual Cube Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 524288/524288 K (Java ...

  3. HDU 6343.Problem L. Graph Theory Homework-数学 (2018 Multi-University Training Contest 4 1012)

    6343.Problem L. Graph Theory Homework 官方题解: 一篇写的很好的博客: HDU 6343 - Problem L. Graph Theory Homework - ...

  4. 2018 Multi-University Training Contest 4 Problem L. Graph Theory Homework 【YY】

    传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6343 Problem L. Graph Theory Homework Time Limit: 2000 ...

  5. The Ninth Hunan Collegiate Programming Contest (2013) Problem L

    Problem L Last Blood In many programming contests, special prizes are given to teams who solved a pa ...

  6. UESTC_Ferris Wheel String 2015 UESTC Training for Search Algorithm & String<Problem L>

    L - Ferris Wheel String Time Limit: 3000/1000MS (Java/Others)     Memory Limit: 43000/43000KB (Java/ ...

  7. Problem L

    Problem Description 在2×n的一个长方形方格中,用一个1× 2的骨牌铺满方格,输入n ,输出铺放方案的总数. 例如n=3时,为2× 3方格,骨牌的铺放方案有三种,如下图: L&qu ...

  8. Gym 102056L - Eventual … Journey - [分类讨论][The 2018 ICPC Asia-East Continent Final Problem L]

    题目链接:https://codeforces.com/gym/102056/problem/L LCR is really an incredible being. Thinking so, sit ...

  9. 2013-2014 ACM-ICPC, NEERC, Southern Subregional Contest Problem L. Stock Trading Robot 水题

    Problem L. Stock Trading Robot 题目连接: http://www.codeforces.com/gym/100253 Description CyberTrader is ...

  10. XVII Open Cup named after E.V. Pankratiev Stage 14, Grand Prix of Tatarstan, Sunday, April 2, 2017 Problem L. Canonical duel

    题目:Problem L. Canonical duelInput file: standard inputOutput file: standard outputTime limit: 2 seco ...

随机推荐

  1. PC端自动化测试实战教程-7-pywinauto等待方法大集合 (详细教程)

    1.简介 经过上一篇的学习和讲解想必小伙伴或者童鞋们已经意识到等待的重要性了吧.宏哥在上一篇中在start()后,加入适当的等待时间(如time.sleep()),让应用程序有足够的时间初始化窗口和U ...

  2. Java 验证电子邮箱是否合法

    工作中,常常遇到校验电子邮箱字符串是否符合规范的需求,这里提供如下两个基于正则表达式的校验方法: public static final String EMAIL_REGEX_DEFAULT = &q ...

  3. 【深入理解Base64编码】原理、应用与Java实战

    深入理解Base64编码:原理.应用与Java实战 目录 1-什么是base64编码 2-base64编码原理详解 3-base64的java实现 4-高级应用与技巧 5-注意事项与常见误区 6-总结 ...

  4. Ai数学基础

    数学基础 1.梯度 1.1偏导数 1.1.1定义 1.1.2几何意义 1.2方向导数 1.2.1定义 1.2.2定理 注:主要运用上面那个公式来计算! 1.3梯度的概念 注:gradf 表示梯度! 1 ...

  5. 鸿蒙Next仓颉语言开发实战教程:订单详情

    幽蓝君听说HarmonyOS 5.1版本即将推送,6.0版本也快要来了,表示十分期待. 今天继续分享仓颉语言开发商城应用的实战教程,今天要分享的是订单详情页: 我们今天应该是第一次遇到分为上中下三部分 ...

  6. 企业微信ipad协议、收发消息、聚合聊天实现

    在当今数字化时代,企业如何有效连接客户.提升营销效率成为了一个重要议题.iPad协议,或称企业微信协议,作为基于微信iPad协议的智能接口服务,优势及其在企业营销中的应用.什么是iPad协议? 帮助& ...

  7. Function AI 工作流发布:以 AI 重塑企业流程自动化

    AI 工作流如何重塑企业自动化流程 在 AI 技术飞速发展的今天,企业的流程自动化方式也正在发生深刻变革.过去,流程自动化往往依赖于人工配置和固定规则,难以适应复杂.多变的业务场景.而如今, 随着 L ...

  8. PTA 4-1

    PTA    习题4-1 求奇数和 (15分) 本题要求计算给定的一系列正整数中奇数的和. 输入格式: 输入在一行中给出一系列正整数,其间以空格分隔.当读到零或负整数时,表示输入结束,该数字不要处理. ...

  9. C#源生成器:让你的代码飞起来的黑科技

    大家好,我是token.今天想和大家聊聊C#源生成器这个神奇的技术. 说起源生成器,可能很多同学会想:又是什么新的轮子?我反射用得好好的,为什么要学这个?别急,看完这篇文章,你就会发现源生成器简直是性 ...

  10. 前端开发系列050-基础篇之组件的概念和使用(Vue)

    本文是早期学习Vue整理的一些阶段性总结,内容主要关于Vue框架中组件的概念和数据传递. 一.组件的相关概念 在Vue学习的时候参考了很多文档和书籍,这些文档和书籍中总是充满各种术语(定语),在这里先 ...