代码:
#include<iostream>
#include<string>
#include<algorithm>
int a,b,c;
using namespace std;
string check(int d)
{
string str,s;
while(d)
{
if(d%10==4||d%10==7)
{
s+=((d%10)+'0');
}
d=d/10;
}
reverse(s.begin(),s.end());
return s;
}
int main( )
{
cin>>a>>b;
if(a<b)
c=b;
else
{
string ss=to_string(b);
int d=a+1;
while(check(d)!=ss)
{
d++;
}
c=d;
}
cout<<c<<endl;
}