-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCPTTRN5.cpp
More file actions
42 lines (41 loc) · 822 Bytes
/
CPTTRN5.cpp
File metadata and controls
42 lines (41 loc) · 822 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <iostream>
using namespace std;
int main() {
int T, l, c, s;
cin >> T;
for (int t = 0; t < T; t++) {
cin >> l >> c >> s;
string border;
for (int i = 0; i < (c * (s + 1) + 1); i ++) border += "*";
cout << border << endl;
for (int i = 0; i < l; i++) {
for (int m = 0; m < s; m++) {
string row = "*";
for (int j = 0; j < c; j++) {
for (int k = 0; k < s; k++) {
string dl, ndl;
if ((i % 2 == 0 && j % 2 == 0) || (i % 2 != 0 && j % 2 != 0)) {
if (m == k) {
row += "\\";
} else {
row += ".";
}
}
else {
if (m + k == s - 1) {
row += "/";
} else {
row += ".";
}
}
}
row += "*";
}
cout << row << endl;
}
cout << border << endl;
}
cout << endl;
}
return 0;
}