编辑代码

#include<iostream>
using namespace std;
int jS(int a,int b)//a为长,b为宽
{
if(a<b||a<=0||b<=0)
{
cout<<"数据不合法";
return -1;
}
if(a%b==0)
{
    return b;
}
int smallb=a%b;
return jS(b,smallb);
}