-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProblem3.c
More file actions
executable file
·34 lines (32 loc) · 830 Bytes
/
Problem3.c
File metadata and controls
executable file
·34 lines (32 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include<stdio.h>
// int main(){
// long long int num = 600851475143;
// long long int i = 5, max = 0;
// while(i * i <= num){
// if(num % i == 0 ){
// if(i > max)
// { max = i;
// printf("%d\n", max);}
// }
// else if(num % (i + 2) == 0){
// if((i + 2) > max){
// max = i + 2;
// printf("%d\n", max);
// }
// }
// i += 6;
// }
// printf("the answer is: %d", max);
// return 0;
// }
int main(){
long long int num = 720 ; //600851475143;
long long int i = 2;
while(i * i < num){
while(num % i ==0)
num = num / i;
i += 1;
}
printf("The answer is: %d, %d", num, i);
return 0;
}