Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
Code corr
SUBMITTED BY:
Guest
DATE:
Nov. 30, 2014, 9:34 p.m.
FORMAT:
Text only
SIZE:
490 Bytes
Raw
Download
Tweet
HITS:
1415
Go to comments
Report
#include <iostream>
#include <cstdio>
// JEDNOCZESNE MIN I MAX
using namespace std;
int main()
{
int n;
scanf("%d",&n);//cin>>n;
int l;
scanf("%d",&l);//cin>>l;
int min = l;
int max = l;
for(int i = 0; i < n-1; i++)
{
scanf("%d",&l);
if(l>max) max = l;
if(l<min) min = l;
}
//cout<<min<<" "<<max;
printf("%d %d",min,max);
return 0;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus