-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path1284.c
More file actions
48 lines (41 loc) · 736 Bytes
/
1284.c
File metadata and controls
48 lines (41 loc) · 736 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include <stdio.h>
int main()
{
int n, i = 2, ch = 0;
scanf("%d", &n);
while (i < n)
{
if (n % i == 0)
{
ch = 1;
for (int j = 2; j < i; j++)
{
if (i % j == 0)
{
ch = 0;
}
}
for (int j = 2; j < n / i; j++)
{
if ((n / i) % j == 0)
{
ch = 0;
}
}
}
if (ch == 1)
{
break;
}
i++;
}
if (ch == 1)
{
printf("%d %d", i, n / i);
}
else
{
printf("wrong number");
}
return 0;
}