diff --git a/others/stairs_pattern.cpp b/others/stairs_pattern.cpp index fcc768016..07ebc7571 100644 --- a/others/stairs_pattern.cpp +++ b/others/stairs_pattern.cpp @@ -12,27 +12,21 @@ where number of pairs line is given by user */ #include using namespace std; -int main() -{ - int l, st = 2, x, r, z, n, sp; - cout << "enter Index "; - cin >> x; - z = x; - for (r = 1; r <= x; r++) - { - z = z - 1; - for (n = 1; n <= 2; n++) - { - for (sp = 1; sp <= z; sp++) - { - cout << " "; - } - for (l = 1; l <= st; l++) - { - cout << "*"; - } - cout << endl; - } - st = st + 2; - } +int main(){ +int l, st = 2, x, r, z, n, sp; +std::cout << "enter Index "; +std::cin >> x; +z = x; +for (r = 1; r <= x; r++){ +z = z - 1; +for (n = 1; n <= 2; n++){ +for (sp = 1; sp <= z; sp++){ +std::cout << " "; } +for (l = 1; l <= st; l++){ +std::cout << "*"; +} +std::cout <<"\n"; +} +st = st + 2; +}}