Guide: 생각하라! 그러면 부자가 되리라. - enrich
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;
}