problem : https://hack.codingblocks.com/contests/c/473/702
code : https://ide.codingblocks.com/#/s/16840
Getting run error in 1 case. Any hints?
problem : https://hack.codingblocks.com/contests/c/473/702
code : https://ide.codingblocks.com/#/s/16840
Getting run error in 1 case. Any hints?
You need to handle the zero case , when N==0
then you cant perform res%a.
if(x!=0)
{ y = modd(b, x);
gcd(x, y);
}
else
{
for(int i=0;i<strlen(b);i++)
cout<<b[i];
}
Hope this works