Advertisement
askarulytarlan

задача 2

Oct 2nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <cmath>
  4. #include <math.h>
  5.  
  6.  
  7. using namespace std;
  8.  
  9. int n;
  10. int c = 1;
  11.  
  12. int main(int argc, const char * argv[]) {
  13.  
  14. cin >> n;
  15. int b = n - 1;
  16. for (int i = 1 ; i <= n ; i++ ) {
  17. for(int j = 1 ; j <= b ; j++ ) {
  18. cout << " ";
  19. }
  20. for(int d = 1 ; d <= c ; d++ ) {
  21. cout << "*";
  22. }
  23. for(int j = 1 ; j < i ; j++ ) {
  24. cout << "*";
  25. }
  26. c = c + 1;
  27. b = b - 1;
  28. cout << endl;
  29. }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement