标签:
裴蜀定理
#include<cstdio> #include<cmath> #include<iostream> using namespace std; int gcd(int x,int y){return y==0?x:gcd(y,x%y);} int n,ans; int main() { scanf("%d",&n); for(int i=1;i<=n;i++) {int x;scanf("%d",&x);ans=gcd(ans,x);} printf("%d",abs(ans)); return 0; }
标签:
原文地址:http://www.cnblogs.com/hyfer/p/5794034.html