fix: stairs pattern not printing slash (#2111)

when we propose 2 backslash then it doesn't take it as a comment and gets printed

Co-authored-by: David Leal <halfpacho@gmail.com>
This commit is contained in:
Harsh Singh 2022-11-19 02:54:39 +05:30 committed by GitHub
parent 3b4d1421d3
commit 34720ae2d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ where number of pairs line is given by user
/** main function */ /** main function */
int main() { int main() {
int l, st = 2, x, r, z, n, sp; int l, st = 2, x, r, z, n, sp;
std::cout << "enter Index "; std::cout << "Enter number of pair - ";
std::cin >> x; std::cin >> x;
z = x; z = x;
for (r = 1; r <= x; r++) { for (r = 1; r <= x; r++) {
@ -26,7 +26,7 @@ int main() {
std::cout << " "; std::cout << " ";
} }
for (l = 1; l <= st; l++) { for (l = 1; l <= st; l++) {
std::cout << "*"; std::cout << "\\*";
} }
std::cout << std::endl; std::cout << std::endl;
} }