int change(int *a, int *b, int k, int l)
{
int changeAtoB, changeBtoA,temp;
int powK=pow(10, k),powL=pow(10, l);
temp = *a / powK;
changeAtoB = temp%10;
temp = *b / powL;
changeBtoA = temp%10;
int difference = abs(changeAtoB - changeBtoA);
if (changeAtoB > difference)
{
*a -= difference * powK;
*b += difference * powL;
}
else
{
*a += difference * powK;
*b -= difference * powL;
}
return 0;
}
наш сайт baitrend.com