We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
int main(){
unsigned long long int N,a,b,k,x,y=0,z=0,i;
scanf("%lld %lld %lld",&N,&a,&b);
while (b!=0)
{
k=b;
b=a%b;
a=k;
}
x=N;
while (x!=0)
{
x=x/10;
y++;
}
for (i=1;i<=a;i++)
printf ("%lld",N);
}
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
GCD Exploration
You are viewing a single comment's thread. Return to all comments →
include
include
int main(){ unsigned long long int N,a,b,k,x,y=0,z=0,i; scanf("%lld %lld %lld",&N,&a,&b); while (b!=0) { k=b; b=a%b; a=k; } x=N; while (x!=0) { x=x/10; y++; } for (i=1;i<=a;i++) printf ("%lld",N); }