-
Notifications
You must be signed in to change notification settings - Fork 0
/
8주차_과제3(1436).c
61 lines (61 loc) · 935 Bytes
/
8주차_과제3(1436).c
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
54
55
56
57
58
59
60
61
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int main()
{
int N;
scanf("%d", &N);
int cnt = 0, i = 0, j = 0;
while (1) {
if (i % 10000 == 6660) {
for (j = 0; j < 10000; j++) {
cnt++;
if (cnt == N) {
printf("%d%04d\n", i, j);
return 0;
}
}
}
else if (i % 1000 == 666) {
for (j = 0; j < 1000; j++) {
cnt++;
if (cnt == N) {
printf("%d%03d\n", i, j);
return 0;
}
}
}
else if (i % 100 == 66) {
for (j = 0; j < 100; j++) {
cnt++;
if (cnt == N) {
printf("%d6%02d\n", i, j);
return 0;
}
}
}
else if (i % 10 == 6) {
for (j = 0; j < 10; j++) {
cnt++;
if (cnt == N) {
printf("%d66%d\n", i, j);
return 0;
}
}
}
else if (i == 0) {
cnt++;
if (cnt == N) {
printf("666\n");
return 0;
}
}
else {
cnt++;
if (cnt == N) {
printf("%d666\n", i);
return 0;
}
}
i++;
}
}