We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #3: Largest prime factor
Project Euler #3: Largest prime factor
Contest ends in
Sort by
recency
|
462 Discussions
|
Please Login in order to post a comment
include
include
include
include
include
include
include
unsigned long long findLargestPrimeFactor(unsigned long long n); int isPrime(unsigned long long n);
int main() { int test_case = 0; scanf("%d", &test_case);
}
unsigned long long findLargestPrimeFactor(unsigned long long n) { unsigned long long largest_prime_factor = 1; if (isPrime(n) == 1) { return n; }
}
int isPrime(unsigned long long n) { for (unsigned long long i = 2; i*i <= n; i++) { if (n % i == 0) { return 0; } }
}
please may i konow the reason why my code is passing only one test codition and remaing all condition are failling and when am giving the manual input am getting the expected output. i have attached my code
include
include
include
include
include
include
include
int main(){ int t; scanf("%d",&t); for(int a0 = 0; a0 < t; a0++){ long n,i,res,k=0;; // int i,res,k=0; scanf("%ld",&n); for(i=2;i
}
PHP