forked from orazaro/accelerated
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02-05.cpp
More file actions
39 lines (33 loc) · 743 Bytes
/
Copy path02-05.cpp
File metadata and controls
39 lines (33 loc) · 743 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
#include <iostream>
using std::cout;
using std::endl;
using std::cin;
int main()
{
const int width = 10;
const int height = 4;
cout << "square" << endl;
for(int i = 0; i < height; ++i) {
for(int j = 0; j < height; ++j)
cout << '*';
cout << endl;
}
cout << "rectangle" << endl;
for(int i = 0; i < height; ++i) {
for(int j = 0; j < width; ++j)
cout << '*';
cout << endl;
}
cout << "triangle" << endl;
for(int i = 0; i < height; ++i) {
for(int j = 0; j <= i; ++j)
cout << '*';
cout << endl;
}
int i = 0;
while (i < 10) {
i += 1;
std::cout << i << std::endl;
}
return 0;
}