c++辗转相除法

2024-12-31 23:15:48
推荐回答(1个)
回答1:

#include
using namespace std;
int main()
{
int a,b,c,d,e;
cout<<"请输入两个整数:"<cin>>a>>b;
d=a;e=b;
do{c=a%b;a=b;b=c;}while(c!=0);
cout<<"最大公约数是:";
cout<cout<<"最小公倍数是:";
cout<return 0;
}