mirror of
https://hub.njuu.cf/TheAlgorithms/C-Plus-Plus.git
synced 2023-10-11 13:05:55 +08:00
Update stairs_pattern.cpp
This commit is contained in:
parent
2b01decae1
commit
9ac7981fed
@ -8,21 +8,20 @@ This program is use to print the following pattern
|
||||
******
|
||||
********
|
||||
********
|
||||
where number of pairs line is given by user
|
||||
*/
|
||||
#include <iostream>
|
||||
int main(){
|
||||
where number of pairs line is given by user */
|
||||
#include<iostream>
|
||||
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++){
|
||||
for (r = 1; r <= x; r++) {
|
||||
z = z - 1;
|
||||
for (n = 1; n <= 2; n++){
|
||||
for (sp = 1; sp <= z; sp++){
|
||||
for (n = 1; n <= 2; n++) {
|
||||
for (sp = 1; sp <= z; sp++) {
|
||||
std::cout << " ";
|
||||
}
|
||||
for (l = 1; l <= st; l++){
|
||||
for (l = 1; l <= st; l++) {
|
||||
std::cout << "*";
|
||||
}
|
||||
std::cout <<"\n";
|
||||
|
Loading…
Reference in New Issue
Block a user