You are viewing a single comment's thread. Return to all comments →
Hey! I was stucked in this problem and so frustrated So, here is the solution (in c++)
int prime(int x){ for(int i=2;i*i<=x;i++){ if(x%i == 0) return false; } return true; } int p(int x){ int d = 1; int digs = 0; while(d <= x){ d *= 10; digs++; } d/=10; for(int k=0;k
THANKS ME LATER! //cout << i <<endl; } } printf("%d\n", sum);
Seems like cookies are disabled on this browser, please enable them to open this website
Project Euler #35: Circular primes
You are viewing a single comment's thread. Return to all comments →
Hey! I was stucked in this problem and so frustrated So, here is the solution (in c++)
int prime(int x){ for(int i=2;i*i<=x;i++){ if(x%i == 0) return false; } return true; } int p(int x){ int d = 1; int digs = 0; while(d <= x){ d *= 10; digs++; } d/=10; for(int k=0;k