文章
59
粉丝
0
获赞
260
访问
5.6k
#include <bits/stdc++.h>
using namespace std;
int gys(int a,int b)
{
if(b==0)return a;
else return gys(b,a%b);
}
int main()
{
int n;
while(cin>>n)
{
vector<int> list;
for(int i=0;i<n;i++)
{
int t;
cin>>t;
list.push_back(t);
}
sort(list.begin(),list.end());
cout<<list.front()<<" "<<list.back()<<" "<<gys(list.front(),list.back())<<endl;
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发