1.欧几里得算法和唯一分解定理
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
#include<iostream> #include<algorithm> #include<cstring> #include<cstdio> using namespace std; int a[1000005]; int GCD(int a,int b) { if(a<b)swap(a,b); return b==0?a:GCD(b,a%b); } int judge(int m) { a[1]/=GCD(a[1],a[0]); for(int i=2;i<m;++i) { a[1]/=GCD(a[i],a[1]); if(a[1]==1) return 1; } return 0; } int main() { int n,m,i; char str[1000005]; scanf("%d",&n); while(n--) { memset(a,0,sizeof(a)); scanf("%s",&str); for (i=0,m=0;str[i]!='