Advertisement
Guest User

Untitled

a guest
Jan 17th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Online C++ Compiler.
  4. Code, Compile, Run and Debug C++ program online.
  5. Write your code in this editor and press "Run" button to compile and execute it.
  6.  
  7. *******************************************************************************/
  8.  
  9. #include <iostream>
  10.  
  11. using namespace std;
  12. void spatiu(int v){
  13.  
  14. for(int j = 0; j < v; j++){
  15. cout << " ";
  16. }
  17. }
  18.  
  19. void isoscel(int x){
  20. string a = "#";
  21. string s = " ";
  22. string b = a + s;
  23. int baza = x;
  24. spatiu(x/2);
  25. cout << a << endl;
  26. while(x != 0){
  27. if(x < 3){
  28. for(int h = 0; h < baza; h++){
  29. cout << "#";
  30. }
  31. b = "";
  32. }
  33. spatiu(x/2 -1);
  34. cout << b + a << endl;
  35. b = b + s + s;
  36. x = x - 2;
  37. }
  38. }
  39. int main()
  40. {
  41. isoscel(20);
  42.  
  43. return 0;
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement