Skip to content

Commit d1cf50c

Browse files
committed
Dislike of Threes
1 parent 693f07b commit d1cf50c

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

1560A.cpp

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#include<bits/stdc++.h>
2+
using namespace std;
3+
4+
int main(){
5+
int t;
6+
cin>>t;
7+
int n;
8+
while(t--){
9+
cin>>n;
10+
int ans;
11+
int i = 0, j = 1;
12+
while(i != n){
13+
if(j%3 != 0 && j % 10 != 3){
14+
ans = j;
15+
j++;
16+
}
17+
else{
18+
j++;
19+
continue;
20+
}
21+
i++;
22+
}
23+
cout<<ans<<endl;
24+
}
25+
}

0 commit comments

Comments
 (0)