-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtask3.c
More file actions
53 lines (49 loc) · 1 KB
/
Copy pathtask3.c
File metadata and controls
53 lines (49 loc) · 1 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//Find the biggest multiple for 600851475143
#include<stdio.h>
#include<locale.h>
#define N 1000
typedef unsigned long long ull;
ull num_enter(ull max);
char *easy_num(int *buf, ull max, int max1);
int main()
{
setlocale(LC_ALL, "Russian");
int buf[N] = { 0 };
ull max =800000000000;
ull result = 0;
result = num_enter(max);
const int max2 = 10;
printf("Number = %llu\n", result);
easy_num(buf, result,max2);
return 0;
}
ull num_enter(ull max)
{
printf("Enter the number!\n");
ull number ;
scanf("%llu", &number);
if (number > max || number < 0)
return -1;
return number;
}
char *easy_num(int *buf, ull max,int max1)
{
ull result = 1;
ull value = 0; int i, j = 0;
for (i = 2; result!= max; i++)
{
value = i;
if (max % value == 0)
{
result *= value;
}
for (j = 0; j < max1;)
buf[j++] = value;
if (max % value != 0)
continue;
for (j = 0; j < 1; j++)
printf("%d\n", buf[j]);
}
printf("Самый большой делитель : %d\n", buf[j]);
return buf;
}