the greatest common divisor

来源:互联网 发布:电脑网络参数怎么修改 编辑:程序博客网 时间:2024/05/16 11:09

the greatest common divisor:

int CMaxDivisorDlg::Compute(int a, int b){    int max,min;    max = a > b ? a : b;    min = a + b - max;    int temp;    while( min ){        temp = min;        min = max % min;        max = temp;    }    return max;}


0 0
原创粉丝点击