Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <initializer_list>
- void test(long long n){
- for (auto i=3; i*i <= n; i+=2) if (n%i == 0) return;
- std::cout << n << std::endl;
- for (int d : {1,3,7,9}) test(10*n+d);
- }
- int main(){
- for (int d : {2,3,5,7}) test(d);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement