Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void vivesti(int arrayInt, string symbol){
- int i = 0;
- while(i<arrayInt){
- cout << symbol;
- i++;
- }
- }
- void stebelko(int probel, string symbol){
- int i = 0;
- while(i < probel){
- cout << symbol;
- i++;
- }
- cout << "*";
- }
- void sdelatElku(int userNum){
- int i=0, arrProbel, arrZvezda;
- string symbol = " ";
- while(i < userNum*2){
- symbol = " ";
- arrProbel = userNum-(i/2);
- vivesti(arrProbel, symbol);
- symbol = "*";
- arrZvezda = i+1;
- vivesti(arrZvezda, symbol);
- cout << endl;
- i+=2;
- }
- symbol = " ";
- arrProbel = userNum;
- stebelko(arrProbel,symbol);
- }
- int main()
- {
- int userNumber,i,j;
- while(1>0){
- cout << " Enter number to build a tree - ";
- cin >> userNumber;
- cout << endl;
- sdelatElku(userNumber);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement