视频链接:
#include<iostream> #include<cmath> using namespace std; int n,a,s; int gcd(int a, int b){ return b==0?a:gcd(b,a%b); } int main(){ cin >> n; for(int i=1;i<=n;i++){ cin >> a; s = gcd(s,abs(a)); } cout << s; return 0; }
标签:gcd,int,定理,524,include,裴蜀 From: https://www.cnblogs.com/dx123/p/16724621.html