티스토리 뷰
#include<iostream>
#include<vector>
#include<stack>
#include<algorithm>
#include<cmath>
#include<queue>
#include<string>
using namespace std;
int main()
{
int N;
cin >> N;
int ans = 0;
string a;
int cal=0;
int i = 1;
while (1)
{
a = to_string(i);
if(a.find("666")!=string::npos)
{
ans++;
}
if (ans == N)
{
cout << i << endl;
break;
}
i++;
}
return 0;
}
'알고리즘' 카테고리의 다른 글
C++ 백준 17204번 죽음의 게임 (0) | 2022.07.12 |
---|---|
C++ 백준 1439번 뒤집기 (0) | 2022.07.12 |
C++ 백준 1049번 기타줄 (0) | 2022.07.10 |
C++ 백준 1026번 보물 (0) | 2022.07.10 |
C++ 백준 2839번 설탕 배달 (0) | 2022.07.06 |