fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. typedef long long ll;
  4. ll n;
  5. int main(){
  6. cin >> n;
  7. ll a = 0, cnt = 0;
  8. while(true){
  9. if(n == cnt) break;
  10.  
  11. if(to_string(a).find("666") != string::npos) cnt++;
  12. a++;
  13. }
  14. }
Success #stdin #stdout 0.01s 5324KB
stdin
2
stdout
Standard output is empty