@abit
271 / 270 / 35
Регистрация: 03.02.2013
Сообщений: 770
|
10.02.2013, 18:40
|
|
C++ | 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
| #include <iostream>
using namespace std;
int main()
{
const int X = 9;
const int Y1 = 5;
const int Y2 = 3;
int z,z1;
for (int j = 0; j!=Y1;++j)
{
for (int i=0; i!=X; ++i)
if ((i == j)||((i+j+1)==(X)))cout<< "*";
else cout << " ";
cout<<endl;
}
for (int j = 0; j!=Y2;++j)
{
z = X-j*X/Y2-j;
z1 = (X - z)/2;
for (int i = 0; i!=z1; ++i) cout<<" ";
for (int i = 0; i!=z; ++i) cout<<"*";
for (int i = 0; i!=z1; ++i) cout<<" ";
cout<<endl;
}
return 0;
} |
|
0
|