Skip to content

Instantly share code, notes, and snippets.

@nahakyuu
Created December 8, 2014 09:40
Show Gist options
  • Save nahakyuu/3a505b7280f943ddfe66 to your computer and use it in GitHub Desktop.
Save nahakyuu/3a505b7280f943ddfe66 to your computer and use it in GitHub Desktop.
codevs
/*
作者:youye
题目:p1201 最小数和最大数
*/
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;
int main(){
int _min,_max;
int n,temp;
cin>>n;
cin>>temp;
_min=_max=temp;
for(int i=1;i<n;i++){
cin>>temp;
_min=min(_min,temp);
_max=max(_max,temp);
}
cout<<_min<<" "<<_max<<endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment