arrow_forward
همه ارسالها
جزئیات ارسال کد#354
برای پسندیدن وارد شوید
1#include <bits/stdc++.h>
2
3using namespace std;
4
5int main() {
6 ios::sync_with_stdio(0);
7 cin.tie(0);
8
9 int n, m;
10 cin >> n >> m;
11
12 for (int i = 0; i < n; ++i) {
13 if (i % 2 == 0) {
14 for (int j = 0; j < m; ++j) {
15 cout << "#";
16 }
17 } else if (i % 4 == 1) {
18 for (int j = 0; j < m - 1; ++j) {
19 cout << "*";
20 }
21 cout << "#";
22 } else {
23 cout << "#";
24 for (int j = 0; j < m - 1; ++j) {
25 cout << "*";
26 }
27 }
28 cout << "\n";
29 }
30}
کد ارسالشده برای داوری خودکار هاتکدز
UTF-8