Advertisement
Promi_38

cf 1574A

Sep 22nd, 2021
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.41 KB | None | 0 0
  1. #include<bits\stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int t;
  8.     scanf("%d", &t);
  9.     while(t--)
  10.     {
  11.         int n, i, j;
  12.         scanf("%d", &n);
  13.         for(j = 0; j < n; j++)
  14.         {
  15.             for(i = 0; i < j; i++) printf("()");
  16.             for(i = 0; i < n - j; i++) printf("(");
  17.             for(i = 0; i < n - j; i++) printf(")");
  18.             printf("\n");
  19.         }
  20.     }
  21. }
  22.  
  23.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement