Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /******************************************************************************
- Online C++ Compiler.
- Code, Compile, Run and Debug C++ program online.
- Write your code in this editor and press "Run" button to compile and execute it.
- *******************************************************************************/
- #include <iostream>
- using namespace std;
- void spatiu(int v){
- for(int j = 0; j < v; j++){
- cout << " ";
- }
- }
- void isoscel(int x){
- string a = "#";
- string s = " ";
- string b = a + s;
- int baza = x;
- spatiu(x/2);
- cout << a << endl;
- while(x != 0){
- if(x < 3){
- for(int h = 0; h < baza; h++){
- cout << "#";
- }
- b = "";
- }
- spatiu(x/2 -1);
- cout << b + a << endl;
- b = b + s + s;
- x = x - 2;
- }
- }
- int main()
- {
- isoscel(20);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement