Skip to content

Instantly share code, notes, and snippets.

@riemannulus
Created July 3, 2017 18:35
Show Gist options
  • Save riemannulus/4907dad611d8e63d097862f6e7b48c65 to your computer and use it in GitHub Desktop.
Save riemannulus/4907dad611d8e63d097862f6e7b48c65 to your computer and use it in GitHub Desktop.
Min, Max
#include <iostream>
/*
불필요한 설명은 제외함
*/
using namespace std;
int main()
{
int t;
int min=1000001, max=-1000001, in;
scanf("%d", &t);
while (t--)
{
scanf("%d", &in);
if (min > in)
{
min = in;
}
if (max < in)
{
max = in;
}
}
printf("%d %d", min, max);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment