看样列出来的
#include <iostream>
using namespace std;
#include <algorithm>
#include <cstdio>
#include <cstring>
int stu[110];
int t;
int main()
{
int i;
while(~scanf("%d",&t))
{
for(i=1;i<=t;++i)
{
scanf("%d",&stu[i]);
}
sort(stu+1,stu+t+1);
while(1)
{
for(i=t;i>=2;--i)
{
if(stu[i]>stu[i-1])
{
stu[i]=stu[i]-stu[i-1];
}
}
sort(stu+1,stu+t+1);
if(stu[1]==stu[t])
{
printf("%d\n",t*stu[1]);break;
}
}
}
return 0;
}