You are viewing a single comment's thread. Return to all comments →
I have done in this way:
Can you please explain what role gcd plays in your code
I have made list of primes till 100 and then checked for the product and counted the possibility. [/code]
std::vector<unsigned long long int> primes; primes.push_back(2); for(long long int i=3; i < 100; i++) { bool prime=true; for(long long int j=0;j<primes.size() && primes[j]*primes[j] <= i;j++) { if(i % primes[j] == 0) { prime=false; break; } } if(prime) { primes.push_back(i); //cout << i << " "; } }
Seems like cookies are disabled on this browser, please enable them to open this website
Leonardo's Prime Factors
You are viewing a single comment's thread. Return to all comments →
I have done in this way:
Can you please explain what role gcd plays in your code
I have made list of primes till 100 and then checked for the product and counted the possibility. [/code]