Advertisement
DimaBishanov

Д/з.№2(e).С++

Mar 13th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. int var;
  8. cout << "vvedute rasmer elku: ";
  9. cin >> var;
  10. int a=0;
  11. while (a < var){
  12.     int b=0;
  13.     while (b < var - a) {
  14.         cout << " ";
  15.         b++;
  16.     }
  17. b = 0;
  18.     while (b < (a*2) - 1) {
  19.         cout << "*";
  20.         b++;
  21. }
  22. cout << endl;
  23. a++;
  24. }
  25. int c = 0;
  26. while (c<var-1) {
  27.     cout << " ";
  28.     c++;
  29. }
  30. cout << "*";
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement