-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathlocker.c
More file actions
39 lines (39 loc) · 718 Bytes
/
Copy pathlocker.c
File metadata and controls
39 lines (39 loc) · 718 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
#include <stdio.h>
#include <stdlib.h>
int main()
{
int n;
scanf("%d", &n);
int arr[n + 1];
for (int i = 1; i <= n; i++)
{
arr[i] = 0;
}
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= n; j++)
{
if (j % i == 0)
{
if (arr[j] == 0)
{
arr[j] = 1;
}
else
{
arr[j] = 0;
}
}
}
}
int open = 0;
for (int i = 1; i <= n; i++)
{
if (arr[i] == 1)
{
open++;
}
}
printf("open = %d\nclose = %d", open, abs(n - open));
return 0;
}