Cod sursa(job #3032595)

Utilizator NiffSniffCojocaru Calin Marcu NiffSniff Data 22 martie 2023 14:56:24
Problema Multiplu Scor 0
Compilator cpp-64 Status done
Runda Arhiva de probleme Marime 0.45 kb
#include <fstream>
using namespace std;
string file = "multiplu";
ifstream cin (file + ".in");
ofstream cout (file + ".out");
int m, gasit;
void bkt(long long x = 0, int l = 0)
{
    if (l < 18 && !gasit)
    {
        bkt(x*10,l+1);
        bkt(x*10+1,l+1);
    }
    else if (x % m == 0 && x && !gasit)
    {
        cout << x;
        gasit = 1;
    }
}
int main()
{
    int a,b;
    cin >> a >> b;
    m = a * b;
    bkt();
}