Skip to content

Commit

Permalink
Merge pull request #10 from B4mbus/cpp-ascii-art-choinka-refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Pixel48 authored Jan 27, 2022
2 parents bd50bf9 + be17208 commit a061536
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions programming/cpp/ascii-art/choinka.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,25 @@
// QQQQQ
// M

#include <string>
#include <iostream>

#include <bits/stdc++.h>
#include <ctime>
using namespace std;

void tree(int size) {
int i = 0;

for(int s = size - 1; s >= 0; s--) {
cout << string(s, ' ') << string(i*2 + 1, 'Q') << endl;
cout << string(s, ' ') << string(i * 2 + 1, 'Q') << endl;
i++;
} cout << string((size-1), ' ') << 'M' << endl;
}

cout << string(size - 1, ' ') << 'M' << endl;
}

main() {
int a;
cin>>a;
int spacja = a-1;
int znak = 1;
int main() {
int size;
cin >> size;

tree(a);

return 0;
}
tree(size);
}

0 comments on commit a061536

Please sign in to comment.