TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
stairs_pattern.cpp
Go to the documentation of this file.
1
14#include <iostream>
15
17int main() {
18 int l, st = 2, x, r, z, n, sp;
19 std::cout << "Enter number of pair - ";
20 std::cin >> x;
21 z = x;
22 for (r = 1; r <= x; r++) {
23 z = z - 1;
24 for (n = 1; n <= 2; n++) {
25 for (sp = 1; sp <= z; sp++) {
26 std::cout << " ";
27 }
28 for (l = 1; l <= st; l++) {
29 std::cout << "\\*";
30 }
31 std::cout << std::endl;
32 }
33 st = st + 2;
34 }
35}
int main()