Advertisement
Promi_38

cf 1560A

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