Created
December 8, 2014 09:40
-
-
Save nahakyuu/3a505b7280f943ddfe66 to your computer and use it in GitHub Desktop.
codevs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
作者: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