Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- long long broj;
- int k;
- cin>>broj>>k;
- long long x=1;
- for (long long i=broj+1; i>0; i+=x)
- {
- int sum=0;
- for (long long y=1; y<i; y*=10)
- {
- if ((i/y)%10==7)
- {
- sum++;
- }
- }
- if ((i/x)%10==7)
- {
- x*=10;
- }
- if (sum>=k)
- {
- cout<<i<<endl;
- break;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement