int CRSADlg::GetPrimaryKey(int first, int second)
{
 int b,x,s,q,e,w,a;
 b = second;
 a = first;
 x = 0;
 s = 1;

 while(a != 1)
 {
  q = b / a;
  e = b - a*q;
        w = x - s*q;
        b = a;
        a = e;
        x = s;
        s = w;
    }
 if(s < 0)
  s = s + second;
    return s;

}

 


댓글(0) 먼댓글(0) 좋아요(1)
좋아요
북마크하기찜하기