标签:
裴蜀定理推广到N个数
具体证明可以类似2个数证明
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<cstring> using namespace std; int n,ans; int Gcd(int a,int b) {if (b==0) return a; return Gcd(b,a%b);} int main() { scanf("%d",&n); for (int x,i=1; i<=n; i++) scanf("%d",&x),ans=Gcd(ans,x); printf("%d",abs(ans)); return 0; }
标签:
原文地址:http://www.cnblogs.com/DaD3zZ-Beyonder/p/5718979.html