#include <stdio.h>
#include<string.h>
#include<math.h>
#define N 200
int a=0;
int EGCD(int r0, int r1, int &r0_inverse, int &r1_inverse)
{
int R0=r0,R1=r1;
if(r0==0 || r1==0)
{
printf("ERROR: One of the two input numbers is zero.\n");
return 0;
}
int a=0;
int q=0,r2=0,s0=1,s1=0,s2=0,t0=0,t1=1,t2=0;
while(r1!=0)
{
q=r0/r1;
r2=r0%r1;
s2=s0-s1*q;
t2=t0-t1*q;
//更新r0、r1、s0、s1、t0、t1
r0=r1;r1=r2;
s0=s1;s1=s2;
t0=t1;t1=t2;
}
a=r0;
printf("THE GCD of R0 AND R1 IS: %d