Update stairs_pattern.cpp

This commit is contained in:
faizan Ahamed 2020-04-19 20:23:48 +05:30 committed by GitHub
parent e4fa1dbcaf
commit e15dd6ec99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -12,27 +12,21 @@ where number of pairs line is given by user
*/
#include <iostream>
using namespace std;
int main()
{
int main(){
int l, st = 2, x, r, z, n, sp;
cout << "enter Index ";
cin >> x;
std::cout << "enter Index ";
std::cin >> x;
z = x;
for (r = 1; r <= x; r++)
{
for (r = 1; r <= x; r++){
z = z - 1;
for (n = 1; n <= 2; n++)
{
for (sp = 1; sp <= z; sp++)
{
cout << " ";
for (n = 1; n <= 2; n++){
for (sp = 1; sp <= z; sp++){
std::cout << " ";
}
for (l = 1; l <= st; l++)
{
cout << "*";
for (l = 1; l <= st; l++){
std::cout << "*";
}
cout << endl;
std::cout <<"\n";
}
st = st + 2;
}
}
}}