Cod sursa(job #3260030)
| Utilizator | Data | 29 noiembrie 2024 08:08:51 | |
|---|---|---|---|
| Problema | Multiplu | Scor | 10 |
| Compilator | cpp-64 | Status | done |
| Runda | Arhiva de probleme | Marime | 0.55 kb |
#include <fstream>
#define int long long
using namespace std;
ifstream in("multiplu.in");
ofstream out("multiplu.out");
int n, mask, j, a, b, x, p;
const int pre = 10000000;
int32_t main()
{
in >> a >> b;
for (mask = 1; mask < (1<<8); mask++)
{
x=0;
p = pre;
for (j = 7; j >= 0; j--)
{
if (mask & (1<<j))
x += 1 * p;
p/=10;
}
if (!(x % a) && !(x%b))
{
out << x;
return 0;
}
}
return 0;
}
