Find the largest prime number factor?

前端 未结 7 1760
别那么骄傲
别那么骄傲 2021-01-29 08:40

I need to find The prime factors of 13195 are 5, 7, 13 and 29. / * Largest is 377. * / What is the largest prime factor of the number 600851475143 ?

#include<         


        
7条回答
  •  走了就别回头了
    2021-01-29 09:31

    600851475143 is probably above the precision of your platform's long data type. It requires at least 40 bits to store. You can use this to figure out how many bits you have:

    #include 
    
    printf("my compiler uses %u bits for the long data type\n", (unsigned int) (CHAR_BIT * sizeof (long)));
    

提交回复
热议问题