<html>
<body>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th>A</th>
<th>C</th>
<th>E</th>
</tr>
<th>B</th>
<th>D</th>
<th>F</th>
</table>
<br>
<th rowspan="2">A</th>
<th colspan="2">A</th>
<th rowspan="2">E</th>
<th colspan="2">B</th>
<col width="75" span="5">
<th rowspan="2" bgcolor="LightGray">A</th>
<th colspan="3">B</th>
<th rowspan="2">C</th>
<th bgcolor="LightGray">G</th>
<th colspan="3">H</th>
<th>I</th>
<th bgcolor="LightGray">A</th>
<th bgcolor="LightGray">C</th>
<th bgcolor="LightGray">E</th>
<th rowspan="2">B</th>
<th>G</th>
<th>H</th>
<col width="75" span="6">
<th rowspan="3">A</th>
<th rowspan="3">D</th>
<th bgcolor="LightGray">F</th>
<th rowspan="2" colspan="3"height="40">H</th>
<th>С</th>
</body>
</html>
Объяснение:
Смотри картинку
Pascal ABC
const
n = 10;
var
i, j: integer;
a: array[1..n, 1..n] of char;
begin
for i := 1 to n do
for j := 1 to n do
if (j >= i) and (j <= n - i + 1) then a[i, j] := '*' else a[i, j] := '+';
for i := 6 to n do
if (j <= i) and (j >= n - i + 1) then a[i, j] := '*' else a[i, j] := '+';
write(a[i, j]:2);
writeln();
end;
end.
C++
using namespace std;
#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
const ll n = 10;
char a[n][n];
for(ll i = 0; i < n; i++)
for(ll j = 0; j < n; j++)
a[i][j] = '+';
ll l = 0, r = n-1;
for(ll i = 0; i < n; i++){
for(ll j = min(l,r); j <= max(l,r); j++)
a[i][j] = '*';
l++;
r--;
}
cout << a[i][j] << " ";
cout << "\n";
<html>
<body>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th>A</th>
<th>C</th>
<th>E</th>
</tr>
<tr>
<th>B</th>
<th>D</th>
<th>F</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th rowspan="2">A</th>
<th>B</th>
<th>C</th>
</tr>
<tr>
<th>D</th>
<th>E</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th colspan="2">A</th>
<th>D</th>
</tr>
<tr>
<th>B</th>
<th>C</th>
<th>E</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th>A</th>
<th>C</th>
<th rowspan="2">E</th>
</tr>
<tr>
<th colspan="2">B</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="5">
<tr>
<th rowspan="2" bgcolor="LightGray">A</th>
<th colspan="3">B</th>
<th rowspan="2">C</th>
</tr>
<tr>
<th>D</th>
<th>E</th>
<th>F</th>
</tr>
</tr>
<tr>
<th bgcolor="LightGray">G</th>
<th colspan="3">H</th>
<th>I</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="3">
<tr>
<th bgcolor="LightGray">A</th>
<th bgcolor="LightGray">C</th>
<th bgcolor="LightGray">E</th>
</tr>
<tr>
<th rowspan="2">B</th>
<th>D</th>
<th>F</th>
</tr>
<tr>
<th>G</th>
<th>H</th>
</tr>
</table>
<br>
<table border="1" cellspacing="0">
<col width="75" span="6">
<tr>
<th rowspan="3">A</th>
<th rowspan="2">B</th>
<th rowspan="3">D</th>
<th bgcolor="LightGray">E</th>
<th bgcolor="LightGray">F</th>
<th bgcolor="LightGray">G</th>
</tr>
<tr>
<th rowspan="2" colspan="3"height="40">H</th>
</tr>
<tr>
<th>С</th>
</tr>
</table>
<br>
</body>
</html>
Объяснение:
Смотри картинку
Pascal ABC
const
n = 10;
var
i, j: integer;
a: array[1..n, 1..n] of char;
begin
for i := 1 to n do
for j := 1 to n do
if (j >= i) and (j <= n - i + 1) then a[i, j] := '*' else a[i, j] := '+';
begin
for i := 6 to n do
for j := 1 to n do
if (j <= i) and (j >= n - i + 1) then a[i, j] := '*' else a[i, j] := '+';
for i := 1 to n do
begin
for j := 1 to n do
write(a[i, j]:2);
writeln();
end;
end;
end.
C++
using namespace std;
#include <iostream>
#include <cmath>
#include <algorithm>
#pragma GCC optimize("Ofast")
#define ll long long
#define ld long double
using namespace std;
signed main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
const ll n = 10;
char a[n][n];
for(ll i = 0; i < n; i++)
for(ll j = 0; j < n; j++)
a[i][j] = '+';
ll l = 0, r = n-1;
for(ll i = 0; i < n; i++){
for(ll j = min(l,r); j <= max(l,r); j++)
a[i][j] = '*';
l++;
r--;
}
for(ll i = 0; i < n; i++){
for(ll j = 0; j < n; j++)
cout << a[i][j] << " ";
cout << "\n";
}
}
Объяснение: