Created
August 28, 2021 05:29
-
-
Save yeopgi/1fe4247fbcc5231c8e4dabf2a51a4fe0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
int main(void) | |
{ | |
ios_base::sync_with_stdio(false); | |
cin.tie(nullptr); | |
int input; | |
cin >> input; | |
int movieSeries = 0; | |
for (int i = 666;; i++) { | |
int temp = i; | |
int isSequence = false; | |
while (temp) { | |
if (temp % 10 == 666) { | |
isSequence = true; | |
break; | |
} | |
temp = temp / 10; | |
} | |
if (isSequence) { | |
movieSeries++; | |
if (movieSeries == input) { | |
cout << i << '\n'; | |
return 0; | |
} | |
} | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment