Pagini recente » Autentificare | Cod sursa (job #40414) | Cod sursa (job #9935) | Cod sursa (job #40515) | Cod sursa (job #250063)
Cod sursa(job #250063)
#include<stdio.h>
int a,b;
long long rez;
void citire()
{
scanf("%d%d",&a,&b);
}
void multiplu()
{
bool gasit=false;
if(a>b)
{
rez=a;
for(;gasit!=true;rez+=a)
if(rez%a==0 && rez%b==0)
gasit=true;
}
else
{
rez=b;
for(;gasit!=true;rez+=b)
if(rez%a==0 && rez%b==0)
gasit=true;
}
for(;rez;)
{
printf("%d",rez%2);
rez/=2;
}
}
int main()
{
freopen("multiplu.in","r",stdin);
freopen("multiplu.out","w",stdout);
citire();
multiplu();
return 0;
}