Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<cmath>
- using namespace std;
- int main()
- {
- int n,p,ok,i,aux,rez;
- cin>>n>>p;
- for(i=0;i<=n;i++)
- {
- ok=1;
- aux=i;
- rez=i;
- while(aux)
- {
- c=aux%10;
- if(c>p) aux=0;
- aux=aux/10;
- }
- if(ok) cout<<rez<<" ";
- }
Advertisement
Add Comment
Please, Sign In to add comment