: ์ผ๋ฐ ์ปจํ ์ด๋์ find๋ end()๊ฐ์ผ๋ก ์ฒ๋ฆฌ๋ฅผ ํ์ง๋ง,
1) ๋ฌด์ํ๊ฒ ํ์ด๋ณด๋๋ก ํ์.
2) ๋ค๋ฅธ ๋ฐฉ๋ฒ์ด ์๋์ง ์ฐพ์๋ณด์.
#include <iostream>
#include <list>
using namespace std;
#include <map>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
// 1436๋ฒ. ์ํ๊ฐ๋
์
// 17:55 ~
int main()
{
int n;
cin >> n;
int num = 666;
int cnt = 0;
while (1)
{
string word = to_string(num);
if (word.find("666") != string::npos)
{
//cout << word << endl;
++cnt;
}
if (cnt == n)
break;
++num;
}
cout << num;
}