最大公因数

#include <iostream>
using namespace std;
int a(int b,int c){
	if(b%c==0){
		return c;
	}else{
	return a(c,b%c);
	}
}
int main() {
	int d,e;
	cin>>d>>e;
	cout<<a(d,e);
	return 0;
}

  

posted @ 2023-07-31 20:06  陈若麟  阅读(5)  评论(0编辑  收藏  举报