Advertisement
Robert_JR

R. Pyramid.cpp

Nov 28th, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.82 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <algorithm>
  4. #include <cmath>
  5. #include <string>
  6. #include <cstdlib>
  7. #define DEBUGG freopen("f:\\in.txt", "rt", stdin);freopen("f:\\out.txt", "wt", stdout);
  8. #define FOR(n) for(int i = 0; i < n; i++)
  9. #define ll long long int
  10. #define TESTCASE int t;scanf("%d", &t);for(int tc = 0; tc < t; tc++)
  11. #define PF printf
  12. #define SF scanf
  13. #define EP 0.000000001
  14. using namespace std;
  15.  
  16. int main()
  17. {
  18.     //DEBUGG
  19.     int n;
  20.     TESTCASE
  21.     {
  22.         cin >> n;
  23.         int temp = 1;
  24.  
  25.         for(int i = n; i > 0; i--)
  26.         {
  27.             for(int j = 1; j < i; j++) cout << ' ';
  28.             for(int j = 0; j < temp; j++) cout << '*';
  29.             cout << endl;
  30.             temp += 2;
  31.         }
  32.         if(tc != t-1)
  33.             cout << endl;
  34.     }
  35.  
  36.  
  37.     return 0;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement