반응형
https://www.acmicpc.net/problem/1436
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
|
#include<iostream>
#include<stdlib.h>
#include<stdio.h>
#include<string.h>
int main(void) {
int N;
std::cin >> N;
int cnt = 0;
for (int i = 666;;++i) {
char str[100];
//itoa(i, str,10);
sprintf(str, "%d", i);
for (int j = strlen(str) - 1;j >= 2;--j) {
if (str[j] == '6' && str[j -1] == '6' && str[j - 2] == '6') {
++cnt;
break;
}
}
if (cnt == N) {
std::cout << i;
break;
}
}
}
http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Colored by Color Scripter
|
반응형