Răspuns:
#include <iostream>
using namespace std;
int main(){
int n;
int k;
int f = 1;
cout << "n=" ;
cin >> n;
cout << "k=" ;
cin >> k;
while (n) {
int c = n%10;
if (c > k)
f = 0;
n /= 10;
}
if (f)
cout << "DA\n";
else
cout << "NU\n";
cout << endl;
return 0;
}
Explicație: