C++ handwritten a divided by b positive remainder

code show as below:

int get_mod(int a,int b)
{
    
    
    return (a%b+b)%b;
}

Guess you like

Origin blog.csdn.net/m0_51955470/article/details/114107267