Ответ:
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
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
#include
#include
#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
a[i][j] = '*';
l++;
r--;
}
for(ll i = 0; i < n; i++){
for(ll j = 0; j < n; j++)
cout
cout
}
}
Объяснение: