DEV Community

gulomov21
gulomov21

Posted on

yuldi<<*>>

include

include

using namespace std;

int main(){

int row;
cin >> row;
int spaces = row - 1;

for(int i = 1; i<= row; i++){
for(int j = 1; j<= spaces; j++){
cout << " ";
}
spaces--;
for(int k = 1; k <= (i*2-1); k++){
cout << "*";
}
cout << endl;
}
spaces = 1;

for(int i = 1; i <= row - 1; i++){
for(int j = 1; j<=spaces; j++){
cout << " ";
}
spaces++;
for(int k = 1; k <= 2*(row-i) -1; k++){
cout << "*";
}
cout << endl;
}

return 0;
}

Top comments (1)

Collapse
 
gulomov21 profile image
gulomov21

star