8160 奇妙数
#include<bits/stdc++.h> #define f(i,s,e) for(int i = s; i <= e; i++) #define ll long long using namespace std; const int N = 1e3+10,inf = 0x3f3f3f3f; int check(int n) { int x = n; while(n != 0) { if(n % 10 != 0 && x % (n % 10) != 0) return 0; n /= 10; } return 1; } int main() { int n,m,f = 0; cin >> n >> m; f(i,n,m) if(check(i)) cout << i << " ",f++; if(!f) cout << -1; return 0; }