?? euclid.cpp
字號:
// Euclid.cpp: implementation of the Euclid class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "affine.h"
#include "Euclid.h"
#include <math.h>
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Euclid::Euclid()
{
}
Euclid::~Euclid()
{
}
int Euclid::Backspin(int d)
{
int Q;
int t1,t2,t3;
int x1=1,x2=0,x3=26;
int y1=0,y2=1,y3=d;
while (y3!=1&&y3!=0) {
div_t div_quot;
div_quot=div(x3,y3);
Q=div_quot.quot;
t1=x1-Q*y1; t2=x2-Q*y2; t3=x3-Q*y3;
x1=y1; x2=y2; x3=y3;
y1=t1; y2=t2; y3=t3;
}
if (y3==0) { return D=0;}
if (y3==1) {
if (y2<0) { y2=y2+26;}
return D=y2;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -