Cod sursa(job #2367452)
Utilizator | Data | 5 martie 2019 10:50:11 | |
---|---|---|---|
Problema | Multiplu | Scor | 20 |
Compilator | cpp-64 | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
#include <bits/stdc++.h>
using namespace std;
ifstream f("multiplu.in");
ofstream g("multiplu.out");
int main()
{long long i,j,z,s=0,sa=0,x=0,loc=0,y,q,a,b;;
f>>a>>b;
for(i=1;i<=2000000;i++){
s=i;
x=0;
while(s>1){
x=x*10+s%2;
s=s/2;
}
if(x%a==0&&x%b==0&&x!=0){g<<x<<" ";break;}
}
return 0;
}